Forum Moderators: open
Lets say I have 7 db entries, each with their own key of the day of the week. How do I use the server time as a variable to compare and pull the right record?
Thanks -
I believe its an Access database. I think this is the line of code, just the syntax is a little different than what was posted.
fp_sQry="SELECT * FROM Results WHERE (startdate = '::today::')"
>>"select field from table where datefield =#" + DATE() + "#"
what is the format of DATE() so i can be sure it will match datefield?
FormatDateTime(now,vbShortDate) will return 5/9/2004
Note: The format of vbShortDate is dependent on the Regional Settings on the server set in Control Panel.
Another idea for you so you don't have to have a record for every day in the future. Have your Database "date" column be a DayOfWeek column instead (1-7). Then calculate the Day of Week in script and you will only require 7 records at any given time.