Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Is there a quicker statement to extract the previous days records?Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Sample Scripts Forum

 New Topic 
 
 Post Reply 
[1]  
 Is there a quicker statement to extract the previous days records? 
 Author   Message 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-02-21 11:34:28

When I execute this statement :-

select invoiceline.txnid from invoiceline where
(invoiceline.TxnDate>= {fn TIMESTAMPADD(SQL_TSI_DAY,-1,{fn CurDate()})})

the query takes hours to execute. BUT if I do this :- 

select * from invoiceline where invoiceline.TxnDate>= {d '2005-11-21'}

it takes 5 seconds.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-02-21 11:35:18
The above highlights the difference when a value is evaluated during execution as opposed to a constant value. QODBC will lose the jumpin/index capability on the date when you apply a function to it.

If you are looking just for yesterday's transactions, then the TxnDateMacro is the one to use :-

SELECT invoiceline.TxnID FROM invoiceline WHERE TxnDateMacro = 'Yesterday'

or for this month:

SELECT invoiceline.TxnID FROM invoiceline WHERE TxnDateMacro = 'ThisMonth'

As it provides constants relative to the date. Other built-in TxnDateMacro values are :-

TxnDateMacro =

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to