Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
j_Southern
Starting Member
2 Posts |
Posted - 2014-12-15 : 05:20:00
|
I use an ODBC link to download from a Sage accounting package into Excel. I use the MSQuery "grid" to enter in my queries and I have recently had difficulties, not encountered before, when I have needed to use a clause limiting data to after a given date [ The SQL should say something like WHERE WM_ORDERS.INVOICE_DATE > #30/11/2013#] I think I used to be careless in how I entered the date because MSQuery would add the hashes and correct the date format. Now, however I enter the date, I get an error message telling me there is a syntax error in the date. I would like some help please with what the correct syntax for a date in MSQuery should be, and if possible what other areas might be impacting on my problem. John |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2014-12-15 : 05:33:44
|
in sql server you can add a date filter by using single quotes to the value.for example where invoicedate='30112013'Javeed Ahmedhttps://www.linkedin.com/pub/javeed-ahmed/25/5b/95 |
|
|
j_Southern
Starting Member
2 Posts |
Posted - 2014-12-15 : 07:34:22
|
Thanks for your interest but no this does not work in MSQuery. I think I will have to write the SQL as a string in VBA. I know that works. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|