Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataType error, BETWEEN, >, < DateTime field 1

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Hi All,
My aim is use 2 dateTimePicker controls so user can search for entries based on dates. should be easy enough i thought.

scratching my head with the SELECT statement.
the field in question is DATA TYPE 'Date/Time/

The following works:

[Header].FromDate LIKE '01/01/2005'

These give me datatype errors

[Header].FromDate < '01/01/2005
[Header].FromDate < '" & DateValue("01/01/2005") & "'"
[Header].FromDate BETWEEN '01/01/2004'AND '01/01/2005'

ive also tried CDate.
i also tried CONVERT(CHAR(8), [Header].FromDate, 3) but i gget an error about an undeclared CONVERT something or other.
i understand that access stores the DateTIme in xxxx.xxxx

can anyone point me towards the light, please?

cheers
rich
 
legend, i tried the # but also left in the ' so had '# if you get my drift, cheers, have a great week
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top