Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Apples
Posting Yak Master
146 Posts |
Posted - 2010-08-25 : 14:49:11
|
| I have a page where a user can create an event. Here is my table:-------------------------------tblEvents-------------------------------EventID | Name | DateStart-------------------------------This is my query for inserting an event:INSERT INTO tblEvents( Name, DateStart)VALUES( @Name, @DateStart)On the page, the user enters the Name in a textbox and enters a DateStart in a textbox (which is in the format 01/01/2010), and the values are passed in as parameters to the query.However, I need to modify my page so that I can set the time for the event as well. Currently, DateStart has the time set to midnight, but I need to have the user set that. There will be 3 dropdowns: one for the hour, one for the minute, and one for AM/PM.How can I change my query to accept the time as well? Is there anything like:INSERT INTO tblEvents( Name, DateStart)VALUES( @Name, DATE(@DateStart,@Hour,@Min,@AMPM)) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Apples
Posting Yak Master
146 Posts |
Posted - 2010-08-25 : 16:25:12
|
| Thank you, I will try that. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|