English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In Excel VBA, I am accessing a Microsoft Project 2003 file as a DB through MS OLE DB provider (Microsoft.Project.OLEDB.11.0). When I shoot an SQL to this which uses string comparisons in the WHERE clause like, TaskName='Coding', it works. But when I compare dates in the WHERE clause, like TaskStart > '07/08/06' or TaskStart > 07/08/06 or TaskStart>#07/08/06#, it does not work. Please let me know how to code the WHERE clause when comparing dates.

2006-08-09 20:31:56 · 5 answers · asked by Meipporul 3 in Computers & Internet Programming & Design

5 answers

Are you sure you are formatting the date properly, and the task_start field is the correct datatype?

Write yourself a query without a filter on the task_start field that returns the task_start value in the result-set, so you can copy/paste that value (as an example of the format) into another SQL query, where you modify the sample-date to match your filter-by date.

2006-08-14 14:43:36 · answer #1 · answered by © 2007. Sammy Z. 6 · 0 0

Vba Compare Dates

2016-11-12 08:10:15 · answer #2 · answered by ? 4 · 0 0

try to convert them to unix timestamp format (number of seconds from January 1st, 1970). there should be a function that does this for you (and back from it). then the comparison is easy, you just compare integers, and you can easily do date manipulations (ie 1 day = 86400 seconds)

2006-08-09 23:58:31 · answer #3 · answered by Bruno 3 · 0 0

You may use the access query tool "Advanced Access Builder" at http://www.download5000.com/page25449.aspx , it allows you to visually build complete SQL scripts.

2006-08-12 01:32:24 · answer #4 · answered by weida 2 · 0 1

I am a database development programer, you use some tools and learn sql(struct query language ). You can get one tool of Advanced SQL Builder at http://www.dlkj.net/sqlBuilder/ . My email is ymx@hdrj.net. OK?

2006-08-10 02:39:34 · answer #5 · answered by Anonymous · 0 2

fedest.com, questions and answers