-
Feb 16th, 2018, 02:40 PM
#1
Thread Starter
Member
[RESOLVED] matching up data types
hello im am trying to match up data types in a sql statement i know the date is # " * Me.Date & " # and a string would be " & Me.Customer & " ' i can not figure out what the rest would be, how would i represent a number
-
Feb 16th, 2018, 03:47 PM
#2
Re: [RESOLVED] matching up data types
For an explanation and examples of delimiters to use around values within SQL statements, see the article How do I use values (numbers, strings, dates) in SQL statements? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)
It doesn't mention Memo, but I think that is treated the same as String/Text.
Note that when putting values into an SQL statement via code, it is far better to use Parameters instead of appending the values as you did, the article above has a link in it for more info.
-
Feb 16th, 2018, 04:05 PM
#3
Thread Starter
Member
Re: [RESOLVED] matching up data types
Originally Posted by si_the_geek
For an explanation and examples of delimiters to use around values within SQL statements, see the article How do I use values (numbers, strings, dates) in SQL statements? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)
It doesn't mention Memo, but I think that is treated the same as String/Text.
Note that when putting values into an SQL statement via code, it is far better to use Parameters instead of appending the values as you did, the article above has a link in it for more info.
what is parmeters
-
Feb 16th, 2018, 04:45 PM
#4
Re: [RESOLVED] matching up data types
Parameters are a way of passing the values to the database (as values), rather than appending them into the SQL statement (as Strings, which you need to format and delimit appropriately for the database you are using).
They have several significant benefits (and the downsides are ignorable), so using them is very widely regarded as a wise move.
More info is in the article I mentioned before: Why should I use Parameters instead of putting values into my SQL string?
-
Feb 16th, 2018, 11:04 PM
#5
Re: [RESOLVED] matching up data types
Originally Posted by cubsm22p
i can not figure out what the rest would be, how would i represent a number
Think about how it works in VB. Date literals are delimited with # symbols and string literals are delimited with double-quotes but how are numeric and Boolean literals delimited? They aren't. Jet SQL is basically the same, with the only difference being that strings are delimited with single-quotes instead of double-quotes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|