Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help required for Date Based Query using Informix SQL

Status
Not open for further replies.

Jamie2002

Technical User
Sep 17, 2001
62
GB
I need some assistance in writing a query, using Informix SQL that will, for each customer sum the amount they have spent in the FIRST 3 months AFTER they registered.

I am finding it difficult to do this in Informix. Using Oracle I would probably use the MONTHS_BETWEEN function. Is there anything similar to this in Informix. I would be grateful if anyone can give me any ponters on this.

The query looks something like this:

Select client.accountnum, client.opendate, sum(transaction.amount)
from clients, transactions
where clients.accountnum = transactions.accountnum
??? and transactions.date between client.opendate and ???
group by 1, 2

Hope this makes sense! Thanks

Jamie
 
Gee, why not post your question in the Informix Forum.

forum179
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top