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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coversion date format

Status
Not open for further replies.

trustsun

Technical User
Feb 4, 2004
73
US
I need to convert the format mm/dd/yyyy hh/mm/ss to just mm/dd/yyyy format and query by paremeter using the format mm/dd/yyyy. But I get the type mismatch error.

A little help and example please.


 
Have you defined the parameter as DateTime ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Using this; GroupDate: Format(DateAdd("d",IIf(([startdatetime]-Int([startdatetime]))<0.25,-1,0),[startdatetime]),"mm/dd/yy dddd")
The field "startdatetime" is mm/dd/yyy hh/mm/yyy, now I need to convert like mm/dd/yyyy only. Possible in another field?
 
Does this raise an error too?
GroupDate: Format([startdatetime],"mm/dd/yy dddd")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Why can't you just use
CDate(Format([startdatetime],"mm/dd/yy"))

That should return the value as a date/time so that your parameters work.


Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top