Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Including date in SQL Where-clause in Excel 2007
I have a table Customers in an external Excel file, which has among others two date fields Started and Ended. In calculation I need to query records where parameter myDate is between Started and Ended. I cannot figure out the Where syntax.
In the Excel source file I can retrieve these record with simple excel functions, so it really works. I have also used the wizard to create the whole SQL statement and this way its working too. However, this where-statement looks like WHERE (Customers.Started<={ts 2017-10-17 00:00:00}) AND (Customers.Ended={ts 2017-10-17 00:00:00}). What do the curly brackets mean? What does the ts mean? In my coded snippet I use ADODB ..Provider = "Microsoft.ACE.OLEDB.12.0" .ConnectionString = "Data Source=" & DBPath & ";" & _ "Extended Properties=""Excel 12.0 Xml;HDR=YES"";" How should a simple where statement look like to work in this case? //Håkan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Including date in SQL Where-clause in Excel 2007
What do the curly brackets mean? What does the ts mean?
What happens if you leave those out? What is the format of the 2 date/time columns? RBS |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Including date in SQL Where-clause in Excel 2007
On Tuesday, October 17, 2017 at 6:58:13 PM UTC+3, wrote:
What do the curly brackets mean? What does the ts mean? What happens if you leave those out? What is the format of the 2 date/time columns? RBS In fact I found a work-around: I changed all dates to numeric value built up of yyyyMMdd. Date format seem to confuse SQL. I thought it handles the dates as Excel serial numbers. HBJ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenate including a date so that the date appears as a date | Excel Worksheet Functions | |||
Can I use a between clause or in clause on an IF statement | Excel Programming | |||
Including today's date | Excel Discussion (Misc queries) | |||
Mimicking an GroupBy Clause in Excel | Excel Programming | |||
VBA excel - problem with having clause in sql with adodb.connection/recordset | Excel Programming |