var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Date Format
I'm looking for some values between two particular dates. I have some data in my database that satisfies the following requirements:
WHERE DatePlacedOnMarket BETWEEN 01/05/2007 AND 30/06/2007;
When I run this query however, nothing appears on the datasheet. Is this to do with the date format I have used?
P.S. I have set the DatePlacedOnMarket field to Date/Time format.
BETWEEN #01/05/2007# AND #30/06/2007#
The #s tell Access it's dealing with dates. The way you have it, it will think they are numbers and will divide 1 by 5 and then by 2007.
And depending on your settings you may have to switch the day and month to the American format.
dates in JET SQL can be problematical
if you have problems then it helpe to encapsulate dates with the hash symbol #
it also helps to specify US date formats
so the SQL probably should look like.....
WHERE DatePlacedOnMarket BETWEEN #05/01/2007# AND #06/30/2007#
Depends where you are using the statement
In the query designer GRID try this
WHERE DatePlacedOnMarket BETWEEN #01/05/2007# AND #30/06/2007#;
In VBA (or query desiger SQL VIEW) try this
WHERE DatePlacedOnMarket BETWEEN #05/01/2007# AND #06/30/2007#;
note American/continetal dates.
Thanks a lot for your replies, it works now. Indeed it was the fact that I wrote the date the wrong way around and I didn't add the hashes!