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 : How can I use Date and Time Timestamp Functions in WHERE clauses?Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 How can I use Date and Time Timestamp Functions in WHERE clauses? 
 Author   Message 
  sri 
  
 Group: Members 
 Posts: 19 
 Joined: 2006-09-27 
 Profile
 Posted : 2007-02-20 01:42:43

Good Day,

How can i use Date and Time Function in where class ?.

i am selecting the Customer Data using the new TimeCreated ,generally i am using the Statement  like this

SELECT ListID,TimeCreated,TimeModified,EditSequence,Name,FullName,IsActive,ParentRefFullName,Sublevel,
CompanyName,Salutation,FirstName,MiddleName,LastName,BillAddressAddr1,BillAddressAddr2,BillAddressAddr3,
BillAddressAddr4,BillAddressCity,BillAddressState,BillAddressPostalCode,BillAddressCountry,ShipAddressAddr1,
ShipAddressAddr2,ShipAddressAddr3,ShipAddressAddr4,ShipAddressCity,ShipAddressState,
ShipAddressPostalCode,ShipAddressCountry,Phone,AltPhone,Fax,Email,Contact,AltContact,CustomerTypeRefFullName,
TermsRefFullName,Balance,TotalBalance,OpenBalance,AccountNumber,PreferredPaymentMethodRefFullName,Notes
FROM Customer where TimeCreated >= {ts'2007-02-01 00:00:00.001'} ORDER BY ListID

i want to the new customer record using by TimeCreated . how can use them to retrive the data.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-02-20 09:17:45

I think you're asking how can you use a date and timestamp function in a WHERE clause. This example will retrieve new customers that have been created in the last 15 minutes:

SELECT ListID,TimeCreated,TimeModified,EditSequence,Name,FullName,IsActive,ParentRefFullName,Sublevel,
CompanyName,Salutation,FirstName,MiddleName,LastName,BillAddressAddr1,BillAddressAddr2,BillAddressAddr3,
BillAddressAddr4,BillAddressCity,BillAddressState,BillAddressPostalCode,BillAddressCountry,ShipAddressAddr1,
ShipAddressAddr2,ShipAddressAddr3,ShipAddressAddr4,ShipAddressCity,ShipAddressState,
ShipAddressPostalCode,ShipAddressCountry,Phone,AltPhone,Fax,Email,Contact,AltContact,CustomerTypeRefFullName,
TermsRefFullName,Balance,TotalBalance,OpenBalance,AccountNumber,PreferredPaymentMethodRefFullName,Notes
FROM Customer where TimeCreated >= {fn TIMESTAMPADD(SQL_TSI_MINUTE, -15, {fn NOW()})} ORDER BY ListID

See: What Time and Date Functions can be used with QODBC? for more information.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to