rfiscus
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by rfiscus
-
-
It is a Numeric (18, 0) field in the database, I've tried changing it to NVARCHAR (50) with the same result. The oddest part about the error is it doesn't occur if I use just the form or just the http query string, only when I put the or between them.
-
notification = Request.Form("notification")notification1 = Request.QueryString("notification")
This works when submitting from a form
sSQL="SELECT top 1 * FROM [Data_Test].[dbo].[Table1],[Data_Test].[dbo].[Table2] where notification = '" & notification & "' and [Data_test].[dbo].[Table2].notification_number = notification"
This works submitting from a url as lookup.asp?notification=545455656
sSQL="SELECT top 1 * FROM [Data_Test].[dbo].[Table1],[Data_Test].[dbo].[Table2] where notification = '" & notification1 & "' and [Data_test].[dbo].[Table2].notification_number = notification"
This does not work with the or, if I use real numbers and test in SQL, it works fine.
sSQL="SELECT top 1 * FROM [Data_Test].[dbo].[Table1],[Data_Test].[dbo].[Table2] where (notification = '" & notification & "' or notification = '" & notification1 & "') and [Data_test].[dbo].[Table2].notification_number = notification"
Does anybody know why this would be? With the or, it fails submitting from the form and from a URL request string.
I get the following error:
Microsoft OLE DB Provider for SQL Server error '80040e07'
Error converting data type varchar to numeric.
Request.QueryString and Request.Form in SQL Query
in ASP
Posted
Heck with it, I just kept the two queries separate and added an If/Then clause, works like a charm.