Jump to content

rfiscus

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by rfiscus

  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. 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.

×
×
  • Create New...