Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
remote query & date range?
Hi,
I'm using Excel 2003 to query a SQL 2000 database. The table I'm querying has a date field, ship_date, and I'd like to be able to have the user of my query specify ship dates before a selected date. Here's what I've tried: I have a simple form with a text field and if the user enters a date in the text field I convert it to text with the format() function and save it in a public variable. Then I concatonate that to my SQL query string like this: strSQL = strSQL & "ship_date < '" & txtShipDate & "') " (the right paren. is closing the where clause) This works in that it doesn't give me any syntax errors but it doesn't work in that it returns no records. I do get the field headers though. Any ideas what I'm doing wrong here? Is there a more elegant solution? This format works fine in the SQL Query Analyzer. Thanks in advance, Linn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import database query that has a date range | Excel Discussion (Misc queries) | |||
How do I enter a date range ie -7 from current date in MS QUERY | Excel Discussion (Misc queries) | |||
HOW DO I CHANGE QUERY DATA TO A DATE RANGE? | Excel Worksheet Functions | |||
Remote data query stopped working | Excel Programming | |||
remote data query and sum not working | Excel Worksheet Functions |