Jump to content

rfiscus

Members
  • Posts

    3
  • Joined

  • Last visited

rfiscus's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Heck with it, I just kept the two queries separate and added an If/Then clause, works like a charm. If Request.Form("notification") <> "" ThensSQL="SELECT * FROM [Data].[dbo].[Table1],[Data].[dbo].[NOTIFICATIONS] where notification = '" & notification & "' and [Data].[dbo].[Table2].notification_number = notification"ElsesSQL="SELECT * FROM [Data].[dbo].[Table1],[Data].[dbo].[NOTIFICATIONS] where notification = '" & notification1 & "' and [Data].[dbo].[Table2].notification_number = notification"End If
  2. 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.
  3. 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.
  4. Why can't I post to the forum, I am signed in?

×
×
  • Create New...