Jump to content

Sub Query problems..


Bendude14

Recommended Posts

ok i am having a problem with this query, if someone could help it would be much appreciated.

 

"SELECT RegNumber, Manufacturer, Model, Km, Transmission FROM Cars WHERE RegNumber=' (SELECT DateIn, RegNumber FROM Cars WHERE DateIn < '" & Now.AddDays(7) & "')'"

 

I have tried this but it dont seem to be working...

 

Thanks

ben

Link to comment
https://forums.phpfreaks.com/topic/150555-sub-query-problems/
Share on other sites

Thanks for that,

 

I found a few other problems and the query runs now but it does not seem to be returning the data i was expecting.

 

"SELECT RegNumber, Manufacturer, Model, Km, Transmission FROM Cars WHERE RegNumber= (SELECT RegNumber FROM Rental WHERE DateIn < '" & Now.AddDays(7) & "')"

 

I am trying to select RegNumber etc from the Cars table WHERE the reg number equals thats of a registration number in the Rental table with a return date (DateIn) less than 7 days from now.

 

I am using VB hence the Now.AddDays, but i figure the SQL is the same.

 

 

Thanks

Ben

Link to comment
https://forums.phpfreaks.com/topic/150555-sub-query-problems/#findComment-790825
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.