General discussion


Access query

By FHP ·
I currently have a linked DBF extract from my Primary system that includes 2 fields; one with the date, and another with the time. I need to be able to capture data for a 24 hour period of time beginning at 3:00am in the morning and ending at 2:59:59 in the morning - - everything I have done has failed.

Does anybody have a solution? I anxiously await....

Please respond to

Regards - -

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Comments

Collapse -

Can't remember all the functions in access

by Tony Hopkinson In reply to Access query

but one approach is to add the date and the time together to get a datetime, add three hours onto that then test the date of said datetime against the day you want.

not as neat but for say for 17/1/2006

select * From extract where
(datefield = '2006-01-17' and timefield >= '03:00')
(dateField = '2006-01-18' and timefield <= '03:00')

or something close anyway.

Have a quick look and see what field types access sees your dbf link as.
One of the classic mistakes is to test
'2001-01-01' against '2001-01-01 06:00:00' which are not equal as the first will be expanded to '2001-01-01 00:00:00'

In this case you need the Date function which truncates a datetime to a date.

If it's seeing them as strings and the dates are in a different format you'll have even more fun.

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums