[thelist] SQL query help: dates
Madhu Menon
chef at shiokfood.com
Thu Feb 17 13:25:39 CST 2005
Anthony Baratta wrote:
>Here's a little pseudo code...
>
>dtNow = DateValue(Now()) & " 00:00:00"
>dtThen = DateValue(Now() + 10) & " 23:59:59"
>
>select CustomerName from tblCustomers
>where birthday between "dtNow" and "dtThen"
Won't work. One thing to remember is that birthdays also record the year of
birth. I'm 30 Nov, 1975, so my birth date would not fall in the range
you've specified (between now and 10 days from now.) ;)
I need a way to just compare months and days and leave the year of birth
out of it.
(And that's also why DateDiff doesn't help.)
Regards,
Madhu
<<< * >>>
Madhu Menon
Shiok Far-eastern Cuisine
Indiranagar, Bangalore
http://www.shiokfood.com
Chef's Notes: http://www.shiokfood.com/notes/
More information about the thelist
mailing list