Forums
This topic is locked
Date(s) Query
Posted 30 Mar 2001 06:08:02
1
has voted
30 Mar 2001 06:08:02 David Chastain posted:
1) How do i concatenate 3 seperate drop-down list/menus form objects into one date value?2) I need to know how to query using two dates (ie arrival & departure. Would i need a DATEDIFF function? When i use a variable for the 2 dates it queries the prices BUT i cannot use an aggregate function ('departure')-1 so that the day of departure is not included in price of the hotel room?
3) Do i use "text" or "date" data type in the table?? Data type mismatch errors???
Much THANKS,
Replies
Replied 03 Apr 2001 22:45:33
03 Apr 2001 22:45:33 George Petrov replied:
1) How do i concatenate 3 seperate drop-down list/menus form objects into one date value?
- Insert a hidden field and the on each of the three fields add a JavaScript in the onChange event that puts the strings together and stores them in the hidden field. It will go something like this:
document.FormName.FullDateHiddenField.value = document.FormName.Month.value + '-' + document.FormName.Days.value + '-' + document.FormName.Year.value
2) Use the DATEDIFF function
3) in your tables use the DATE data type. In SQL Server its called datetime
Greetings,
George Petrov
www.UDzone.com
- Insert a hidden field and the on each of the three fields add a JavaScript in the onChange event that puts the strings together and stores them in the hidden field. It will go something like this:
document.FormName.FullDateHiddenField.value = document.FormName.Month.value + '-' + document.FormName.Days.value + '-' + document.FormName.Year.value
2) Use the DATEDIFF function
3) in your tables use the DATE data type. In SQL Server its called datetime
Greetings,
George Petrov
www.UDzone.com
Replied 14 Jan 2003 17:17:41
14 Jan 2003 17:17:41 paul mortlock replied:
George, I am trying to achieve this javascript concatenation. I have added your code into an OnChange javascript. I receive this error 'document.documentsearch.year.value' is null or not an object. I have a field called year on a form called documentsearch - thanks.