Problems with querying a query

Results 1 to 3 of 3

Thread: Problems with querying a query

  1. #1
    Mark Guest

    Default Problems with querying a query

    The following line of code querys an Access DB table:<BR><BR>querybooking = "select * from [Bookings] where 1 = 1"<BR><BR>if len(bookDate) &#062; 0 then<BR>querybooking = querybooking & " and [Date] like &#039;" & bookDate & "&#039;"<BR>end if <BR> <BR>Bookings is a table in Access. I want to do exactly ythe same query but instead of base it on the Bookings table, use a query. ASP (or Access) does not seem to like this (the error I get is: Not a valid alias). What could this be, any ideas???<BR><BR>p.s. I replace &#039;Bookings&#039; by the relevant query name in the above code.<BR><BR>Thanks <BR><BR>Mark

  2. #2
    Eddie Campbell Guest

    Default RE: Problems with querying a query

    Well, I&#039;m not sure why it complains when you change the table name to a query name, but I would certainly take issue with your field names.<BR><BR>1) Date is a reserved word (I know you have it in [] brackets, but still...<BR>2) What kind of a field name is 1 ?<BR><BR>What is the name of your query ? Maybe that is a reserved name as well ?

  3. #3
    Mark Guest

    Default RE: Problems with querying a query

    1 was just used to show all records. if it was 1 = 2 then this would not show any records as 1 does not = 2. Also if I arrange for the query data to be sent to a table the table can be lloked up by the asp but the original query can not. I therefore do not think it is the fields.<BR><BR>The querys have had several names from zzz to comp availability<BR><BR>Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts