dbTalk Databases Forums  

How to pass a date parameter to Timberline via the TL ODBC driver

comp.databases.btrieve comp.databases.btrieve


Discuss How to pass a date parameter to Timberline via the TL ODBC driver in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jphilipps
 
Posts: n/a

Default How to pass a date parameter to Timberline via the TL ODBC driver - 03-17-2005 , 09:02 PM






I have an application that imports data from a Timberline database via
Timberline's own ODBC driver. The application is written in C# and
uses the MS ODBC.Net provider to connect to a Timberline database via a
DSN set up with the Timberline ODBC driver.

I need to understand how to pass a date as a parameter in a query to
get the results that I am looking for (ex. SELECT Job FROM
MASTER_JCM_JOB_1 WHERE Date_Stamp > #1/1/2000#).

I have many other queries that work fine, but they use text fields as
parameters. Depending on how I use the date I either get a syntax
error or an invalid date error. I have tried wrapping the date(s) in
brackets, braces, parenthesis, single quotes, and pound signs. I have
also had successful queries created in Access 2003 or MS Query 8.0 that
do not work when pasted into the code and run within the application.

Any help would be greatly appreciated.


Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: How to pass a date parameter to Timberline via the TL ODBC driver - 03-19-2005 , 01:01 AM






That's the wonderful thing about standards -- there are so many from
which to choose!

Try specifying the date in ODBC format ( '2005-03-18' ) & see if that
helps. If Timberline did something like Pervaisve, then you can try
something like this ( {d '2005-03-18'} ), or even ( CONVERT(
'2005-03-18', SQL_DATE) ). One of these should work.
(In all examples, leave off the parentheses...
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive.SQL Service & Support - July 19-22 ***
*** Chicago: Pervasive DataExchange Class - July 27-29 ***

jphilipps wrote:

Quote:
I have an application that imports data from a Timberline database via
Timberline's own ODBC driver. The application is written in C# and
uses the MS ODBC.Net provider to connect to a Timberline database via
a DSN set up with the Timberline ODBC driver.

I need to understand how to pass a date as a parameter in a query to
get the results that I am looking for (ex. SELECT Job FROM
MASTER_JCM_JOB_1 WHERE Date_Stamp > #1/1/2000#).

I have many other queries that work fine, but they use text fields as
parameters. Depending on how I use the date I either get a syntax
error or an invalid date error. I have tried wrapping the date(s) in
brackets, braces, parenthesis, single quotes, and pound signs. I have
also had successful queries created in Access 2003 or MS Query 8.0
that do not work when pasted into the code and run within the
application.

Any help would be greatly appreciated.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.