Craigieboy
Programmer
Hi ASP friends,
This one is driving me a little mad and I know it shouldn't be.
Using a SQL statement I am required to find the next day's date from the one the user would input into a form. In Query Analyzer I can get the exact result I am looking for. My query is this -
DECLARE @mydate SMALLDATETIME
SET @mydate = '28-Feb-2002'
SELECT @mydate
SELECT DATEADD(d,1,@mydate) AS thenextday
(a copy and paste into QA will show you it working)
Now, when I move this into ASP I can't seem to pull out my result and display it on my page. Can someone tell me what I'm doing wrong. Here is my ASP code:
startdate = "28-Feb-2002" (or whatever the user input was)
sql = "DECLARE @mydate SMALLDATETIME SET @mydate ='" & startdate & "' SELECT DATEADD(d,1,@mydate) AS nextday FROM tbl_template_check"
Set inetRS = oConn.Execute(sql)
My problem is now the display part. The result of this query is 1-Mar-2002. How do I display this, perhaps using a Response.Write?
Any help would be really appreciated.
Many thanks in advance,
Craig
This one is driving me a little mad and I know it shouldn't be.
Using a SQL statement I am required to find the next day's date from the one the user would input into a form. In Query Analyzer I can get the exact result I am looking for. My query is this -
DECLARE @mydate SMALLDATETIME
SET @mydate = '28-Feb-2002'
SELECT @mydate
SELECT DATEADD(d,1,@mydate) AS thenextday
(a copy and paste into QA will show you it working)
Now, when I move this into ASP I can't seem to pull out my result and display it on my page. Can someone tell me what I'm doing wrong. Here is my ASP code:
startdate = "28-Feb-2002" (or whatever the user input was)
sql = "DECLARE @mydate SMALLDATETIME SET @mydate ='" & startdate & "' SELECT DATEADD(d,1,@mydate) AS nextday FROM tbl_template_check"
Set inetRS = oConn.Execute(sql)
My problem is now the display part. The result of this query is 1-Mar-2002. How do I display this, perhaps using a Response.Write?
Any help would be really appreciated.
Many thanks in advance,
Craig