PDA

View Full Version : how to refer datetime picker control in query.



pramoc
07-16-2007, 04:48 AM
i have query which pull record from table on basis of value of datetime picker control.


query is
SELECT ect.sn AS ServiceNo, ect.pn AS PurchaserNo, ect.cd AS CuttoffDate, ect.dt AS LastModified, ect.s AS status, ect.dc AS DoerComment, ect.rc AS ReviewerComment
FROM ect
WHERE ([cd]=forms!doer!datetimepicker8 );


i dont get any result plz help

andrew93
07-18-2007, 03:47 AM
Hi

The date/time picker control returns both the date and the time. Where it cannot find a match with your data then your query will return nothing. This worked for me in a test so try using this instead:

WHERE (ect.cd = Format(Forms!doer!datetimepicker8.Value, "dd/mm/yy"))
You may need to change the date format to "mm/dd/yy" if that is the format you use. If this doesn't work then you may need to wrap the date value in # symbols.

HTH, Andrew