Jun 10, 2003 #1 sivi IS-IT--Management Nov 27, 2002 27 GB I would be grateful for any help in the following: I need to read a date input from the user in SQL. This date will be used as a parameter in an SQL query. Please someone could advice me on this. If this is possible how this could be done. Many Thanks Sivi
I would be grateful for any help in the following: I need to read a date input from the user in SQL. This date will be used as a parameter in an SQL query. Please someone could advice me on this. If this is possible how this could be done. Many Thanks Sivi
Jun 10, 2003 #2 ClaireHCM IS-IT--Management Mar 26, 2003 772 US Usually we use getdate() to catch the system time.But I am not really sure what do you really mean? here is an example insert into table_name select 1,'John',getdate() Upvote 0 Downvote
Usually we use getdate() to catch the system time.But I am not really sure what do you really mean? here is an example insert into table_name select 1,'John',getdate()
Jun 10, 2003 Thread starter #3 sivi IS-IT--Management Nov 27, 2002 27 GB Claire Thanks for your reply. My requirement is to read a date from the user which will be inputted on the screen. I normally do this in VB and send the inputted value as a parameter to a stored procedure in SQL. But I want to read from the user on the screen from within SQL. Thanks Sivi Upvote 0 Downvote
Claire Thanks for your reply. My requirement is to read a date from the user which will be inputted on the screen. I normally do this in VB and send the inputted value as a parameter to a stored procedure in SQL. But I want to read from the user on the screen from within SQL. Thanks Sivi
Jun 10, 2003 #4 pascalsql Programmer Mar 26, 2003 35 FR SQL Server is not a client interface. It's not its duty to create a nice prompt with blinking color and basic check. What is your client (access, vb, asp...)? Also search "raiseerror" to check the validity of the parameters and return an error Upvote 0 Downvote
SQL Server is not a client interface. It's not its duty to create a nice prompt with blinking color and basic check. What is your client (access, vb, asp...)? Also search "raiseerror" to check the validity of the parameters and return an error
Jun 10, 2003 #5 SQLBill MIS May 29, 2001 7,777 US In SQL Server, you would create a stored procedure that accepts one or more variables and then the user would execute that stored procedure. For example: create procedure udp_myprocedure as declare @mydate datetime select * from mytable where mydatefield > @mydate that creates the stored procedure and this would run it: exec udp_myprocedure '2003-06-10 12:00:00' Check the Books OnLine for more information on stored procedures, create procedure, and variables. -SQLBill Upvote 0 Downvote
In SQL Server, you would create a stored procedure that accepts one or more variables and then the user would execute that stored procedure. For example: create procedure udp_myprocedure as declare @mydate datetime select * from mytable where mydatefield > @mydate that creates the stored procedure and this would run it: exec udp_myprocedure '2003-06-10 12:00:00' Check the Books OnLine for more information on stored procedures, create procedure, and variables. -SQLBill
Jun 10, 2003 Thread starter #6 sivi IS-IT--Management Nov 27, 2002 27 GB pascalsql, SQLBill Many thanks for your comments. Our interface is vb, but SQLBill's suggestion will help the situation. Sivi Upvote 0 Downvote
pascalsql, SQLBill Many thanks for your comments. Our interface is vb, but SQLBill's suggestion will help the situation. Sivi