Jet Data Types

Data Type Jet Field Data Types Delimiter Example
Numeric Long Integer
Integer
Byte
Single
Double
Currency
No delimiter CustID = 1
Text Text
Memo
Quoted CustLast = ‘Garrick’
Note: Jet allows the use of either single or double quotes. For the best compatibility with other database engines, you should stick with using single quotes. Also note that if the value contains a single quote, you need to replace it with two single quotes. (You may wish to write a simple procedure to replace all instances of a single quote in a string with two single quotes.)
Date DateTime Pound Sign (#) OrdDate = #1/1/1980#
Note: If you’re planning to eventually upsize a Jet database to SQL Server, date comparisons in SQL strings may be a problem since SQL Server uses single quotes as date delimiters. Here again, a small procedure that builds the appropriate string may be useful. Also note that regardless of your international settings, you must always use the U.S. date formats mm/dd/yy or mm/dd/yyyy.
Boolean Yes/No
Any integer type
N/A, use the True keyword CustIsApproved = True
Note: You can use true with any numeric field or a Yes/No (Boolean) field. Like Visual Basic in general, Jet treats any non-zero value as True and zero as False. If you look at a Yes/No column in an Access datasheet, you’ll see that, also like VB, Jet stores -1 for True. Don’t, however, compare to -1, use the True keyword.
Nulls All N/A, use IS NULL CustAddress IS NULL
Note: See below under Comparison Operators for more on Nulls

Comments are closed.