Unanswered: Trouble running a query with date criteria!
Hi. I sure hope someone can help, or I won't be sleeping tonight. I'm have to run a query that draws from two relational tables. The criteria I need to use is a date. I got one hint that the language set U.S. vs. Can. has something to do with it, and have tried both languages as Microsoft program defaults, without success. I would be most grateful if someone could help me with this.
Hi. I have formatted the date to be mm/dd/yyyy, but I cannot enter it as such. I have to enter as dd/mm/yyyy in the Design view in order for it to show up as mm/dd/yyyy on the datasheet view. I know this is going to be a problem for others trying to enter anything onto any database I create. Someone did say that they had to change something on their computer to American format, but I've already done that through the control panel. Any other ideas?
when using dates in queries, its always a good idea to bracket them with the hash symbol #
select <mydatevalue> from <mytable> where <mydatevalue> = "#02 Dec 2007#"
select <mydatevalue> from <mytable> where <mydatevalue> = "#12/02/2007#"
you can always change vlaues in a query by using an explicit foramt statement
say you have a control on your form with a date in called mydatecontrol
select <mydatevalue> from <mytable> where <mydatevalue> = "#" & format(mydatecontrol,"mm/dd/yyyy") & "#"
as to how that plays int he datasheet view I'm not too sure.. primarily because I don't use the datasheet view in any apps I develop.. although they aren't quite the spawn of the devil that most domain functions are, they are gettign pretty close. The price for the familiar 'spreadsheet' dislay is just too high.