CortoMaltes
Programmer
I looked in the FAQs and didn't find the help I need so I hope that any of you may help me with this (ASP/MS Access/SQL query).
I have a page where users may display all future events. To do so I use the SQL:
queF = "SELECT * FROM Events WHERE (Start_Date BETWEEN " & EDate & " AND " & DateVal & " OR End_Date BETWEEN " & EDate & " AND " & DateVal & "
" & PresentAdd & ""
EDate = current date
DateVal = last day of year
PresentAdd = session SQL condition (e.g. "AND Status='member') to condition the information displayed to public users or members only
The query runs fine both in Access and in the ASP on IIS 5 (my PC). However, it doesn't return results when run on IIS 4 (the server where the site runs). I have thought of date format issues (my dates are stored in the format dd/mm/yyyy (short format); my PC uses this format; I am trying to check which are the regional date settings on the server. I am almost sure that this must be the problem...) but all the information I find about date querying points to identical solutions:
- Do not store dates as Date field (i.e. use Text fields to store the date in the format desired)
- When querying date fields, manipulate the date to match the database format
My question is: Is there any way I can define the database field as Date, use the format that I want (dd/mm/yyyy) and not worry about the server's regional settings? What would be the least cumbersome way to handle date querying and make sure the query works, independent of the platform? Thank sin advance for helpful hints
I have a page where users may display all future events. To do so I use the SQL:
queF = "SELECT * FROM Events WHERE (Start_Date BETWEEN " & EDate & " AND " & DateVal & " OR End_Date BETWEEN " & EDate & " AND " & DateVal & "
EDate = current date
DateVal = last day of year
PresentAdd = session SQL condition (e.g. "AND Status='member') to condition the information displayed to public users or members only
The query runs fine both in Access and in the ASP on IIS 5 (my PC). However, it doesn't return results when run on IIS 4 (the server where the site runs). I have thought of date format issues (my dates are stored in the format dd/mm/yyyy (short format); my PC uses this format; I am trying to check which are the regional date settings on the server. I am almost sure that this must be the problem...) but all the information I find about date querying points to identical solutions:
- Do not store dates as Date field (i.e. use Text fields to store the date in the format desired)
- When querying date fields, manipulate the date to match the database format
My question is: Is there any way I can define the database field as Date, use the format that I want (dd/mm/yyyy) and not worry about the server's regional settings? What would be the least cumbersome way to handle date querying and make sure the query works, independent of the platform? Thank sin advance for helpful hints