Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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