query not working

From: Bhavna (anonymous_at_discussions.microsoft.com)
Date: 02/29/04


Date: Sun, 29 Feb 2004 07:06:06 -0800

Hi,

Im trying to write a query that will select the date of departure for a specific Caravan Inventory no. The dates retrieved must be less than the date specifed by the user (@Prop_arrival_Dt)
The problem i am having is that some of the dates retrieved are not less than the date value passed in. This line.....(a.Dt_Of_Departure < @Prop_arrival_dt) does not seem to be working correctly.
Does anyone have any idea what i may be doin wrong??

SELECT a.Dt_Of_Departure
FROM dbo.Booking a INNER JOIN
               dbo.Caravan_Booking b ON a.BookingNo = b.BookingNo
WHERE (b.Caravan_Inv_No = @InvNo)
AND (a.Dt_Of_Departure < @Prop_arrival_dt)



Relevant Pages

  • Re: Averaging Time from mulitple tables
    ... Your middle query won't show the TimeExited correctly. ... The subquery is part of the SELECT clause, ... AS MinDepartTime ... Add a subquery to get the matching departure time. ...
    (microsoft.public.access.queries)
  • Re: Averaging Time from mulitple tables
    ... you must have some way to match the arrival record in one table with the departure record in the other table--a common ClientID or TicketID number. ... Create a query that shows the arrival time. ... Once you have the subquery returning the correct date time value, use DateDiffto calculate the difference in minutes. ...
    (microsoft.public.access.queries)
  • Re: Setting Up A Query Showing Count Of Fields
    ... FROM Iotas as X INNER JOIN YourQuery as T ... SELECT company, departure FROM tableName ... I have a Query which has the following Fields. ... I know it has something to do with a Crosstab Query but I am having ...
    (microsoft.public.access.queries)
  • Re: Date Difference
    ... If you are trying to find the difference betwen arrival date and departure ... then use a separate field in your query ... datediff("D", date1, date2) ...
    (microsoft.public.access.gettingstarted)
  • Re: Setting Up A Query Showing Count Of Fields
    ... arrival AS theDate FROM tableName ... SELECT company, departure FROM tableName ... I have a Query which has the following Fields. ...
    (microsoft.public.access.queries)