Filters data with SQL imports in excel

Dark0Prince

Active Member
Joined
Feb 17, 2016
Messages
433
I don't know how to use SQL to write "in less than" "Today-10 days" using the wizard. I just started using SQL and hope this is the write place to ask. The column I'm filtering is a date so the in less than comes write up, but i don't know how to do the second part.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
maybe

YourDateField < (Date - 10)

this is done by editing the SQL. so either in the wizard (at the last step of the wizard choose the option to edit), or from the worksheet via the data connection properties/definition, or via VBA
 
Upvote 0
I get an error that says Didn't expect '<' after the select column list
Code:
SELECT Dbtr_General_Inf.ACCOUNT_NUM1, Dbtr_General_Inf.Last_Name, Dbtr_General_Inf.First_Name, Dbtr_General_Inf.Address_Line_1, Dbtr_General_Inf.Address_Line_2, Dbtr_General_Inf.City, Dbtr_General_Inf.State, Dbtr_General_Inf.Zip_Code, Dbtr_Clnt_Generl_Inf.AcctNUM_From_Client, 
Dbtr_Status.Disposition, Dbtr_Status.Paid_In_Full_Date
Paid_In_Full_Date < (Date - 10)
FROM SQLUser.Dbtr_Clnt_Generl_Inf Dbtr_Clnt_Generl_Inf, SQLUser.Dbtr_General_Inf Dbtr_General_Inf, SQLUser.Dbtr_Status Dbtr_Status
WHERE Dbtr_Clnt_Generl_Inf.ACCOUNT_NUM = Dbtr_General_Inf.ACCOUNT_NUM AND Dbtr_Clnt_Generl_Inf.ACCOUNT_NUM = Dbtr_Status.ACCOUNT_NUM AND Dbtr_General_Inf.ACCOUNT_NUM = Dbtr_Status.ACCOUNT_NUM AND 
((Dbtr_General_Inf.ACCOUNT_NUM1=622201))
ORDER BY Dbtr_Status.Paid_In_Full_Date
 
Upvote 0

Forum statistics

Threads
1,216,063
Messages
6,128,559
Members
449,458
Latest member
gillmit

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top