Hi
I have the following code which runs fine as a query in SQL but when I try and insert it into Excel I get the following message "The conversion of a varchar data type to a smalldatetime datatype resulted in and out of range value"
SELECT JourneyHeader.JourneyDate, Vehicle.Name, JourneyHeader.DriverName, JourneyHeader.VehicleName,
JourneyHeader.JourneyNumber, JourneyHeader.TotalVolume, JourneyLine.DropNumber, [148-vwOrderHeadCP].DeliveryAddress,
Customer.Name, Customer.County, Customer.PostCode
FROM (((JourneyHeader INNER JOIN JourneyLine ON JourneyHeader.JourneyID = JourneyLine.JourneyID)
INNER JOIN Vehicle ON JourneyHeader.VehicleID = Vehicle.VehicleID)
INNER JOIN [148-vwOrderHeadCP] ON JourneyLine.OrderID = [148-vwOrderHeadCP].OrderID)
INNER JOIN Customer ON [148-vwOrderHeadCP].CustomerID = Customer.CustomerID--WHERE (((JourneyHeader.JourneyDate)=#6/23/2015#));
where (((JourneyHeader.JourneyDate between '2015-06-23 00:00:00' and '2015-06-23 23:59:59')))
I have tried to go into the MSquery from Excel to change the way the dates are asked for but it wont show graphically.
So is there a way for SQL to prompt for 2 dates in the code and if so how
many thanks
I have the following code which runs fine as a query in SQL but when I try and insert it into Excel I get the following message "The conversion of a varchar data type to a smalldatetime datatype resulted in and out of range value"
SELECT JourneyHeader.JourneyDate, Vehicle.Name, JourneyHeader.DriverName, JourneyHeader.VehicleName,
JourneyHeader.JourneyNumber, JourneyHeader.TotalVolume, JourneyLine.DropNumber, [148-vwOrderHeadCP].DeliveryAddress,
Customer.Name, Customer.County, Customer.PostCode
FROM (((JourneyHeader INNER JOIN JourneyLine ON JourneyHeader.JourneyID = JourneyLine.JourneyID)
INNER JOIN Vehicle ON JourneyHeader.VehicleID = Vehicle.VehicleID)
INNER JOIN [148-vwOrderHeadCP] ON JourneyLine.OrderID = [148-vwOrderHeadCP].OrderID)
INNER JOIN Customer ON [148-vwOrderHeadCP].CustomerID = Customer.CustomerID--WHERE (((JourneyHeader.JourneyDate)=#6/23/2015#));
where (((JourneyHeader.JourneyDate between '2015-06-23 00:00:00' and '2015-06-23 23:59:59')))
I have tried to go into the MSquery from Excel to change the way the dates are asked for but it wont show graphically.
So is there a way for SQL to prompt for 2 dates in the code and if so how
many thanks