Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Passing Dates criteria in MS Query

You are correct with the square brackets but you need to add the prompt text
between the brackets

[Start Date] and [End Date]

--
HTH...

Jim Thomlinson


"RW" wrote:

I am trying to use MS Query to briong back data from DB2 tables. I have the
query set up in the design view. I have several sets of criteria.

Field1 = '1'
Field2 = 'Y'
Test Date Between #2/1/08# and #2/29/08

The query runs and returns the correct data.

However, I need the dates to equal 2 cells on a worksheet. I have tried
using Between [ ] and [ ] as well as Between #[ ]# and #[ ]# but neither
works.

The sql shows the date criteria as
Between {d '2008-02-01'} and {d '2008-02-29'}

I have even tried to replace the '2008-02-01' and '2008-02-29' with [ ] and
also with ? without success.

What is the proper syntax to initiate the prompts so that I can set the
parameters on cells on an excel spreadsheet?

TIA

  #2   Report Post  
Posted to microsoft.public.excel.misc
RW RW is offline
external usenet poster
 
Posts: 49
Default Passing Dates criteria in MS Query

Ok, it is now initiating prompts but I get an error message:

CLI0113E: SQLSTATE 22007 An invalid Datetime format was detected; that is,
an invalid string representation or value was specified. SQLSTATE=22007

I have tried numerous date formats, with and without #'s, 's, etc. without
success in passing the dates. Again, I am querying db2 tables.

I searched the net for CLI0113E and found the problem but not any solutions.

Any Ideas?

Thanks again.

"Jim Thomlinson" wrote:

You are correct with the square brackets but you need to add the prompt text
between the brackets

[Start Date] and [End Date]

--
HTH...

Jim Thomlinson


"RW" wrote:

I am trying to use MS Query to briong back data from DB2 tables. I have the
query set up in the design view. I have several sets of criteria.

Field1 = '1'
Field2 = 'Y'
Test Date Between #2/1/08# and #2/29/08

The query runs and returns the correct data.

However, I need the dates to equal 2 cells on a worksheet. I have tried
using Between [ ] and [ ] as well as Between #[ ]# and #[ ]# but neither
works.

The sql shows the date criteria as
Between {d '2008-02-01'} and {d '2008-02-29'}

I have even tried to replace the '2008-02-01' and '2008-02-29' with [ ] and
also with ? without success.

What is the proper syntax to initiate the prompts so that I can set the
parameters on cells on an excel spreadsheet?

TIA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Query String into MS Excel napval Excel Discussion (Misc queries) 0 June 19th 07 06:04 AM
passing dates in a conditional sum(if) Neophyte New Users to Excel 2 March 31st 07 05:35 AM
db query with dynamic criteria Stanley Excel Discussion (Misc queries) 1 January 19th 06 07:47 PM
query criteria question Dcbrown428 Excel Discussion (Misc queries) 1 November 18th 05 05:20 PM
Microsoft query criteria help tina Excel Discussion (Misc queries) 0 April 20th 05 02:59 PM


All times are GMT +1. The time now is 04:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"