For Programmers: Free Programming Magazines  


Home > Archive > PowerBuilder > May 2004 > using DateAdd to get contracts with end dates within one year of start dates









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author using DateAdd to get contracts with end dates within one year of start dates
Shahryar Rizvi

2004-05-14, 5:32 pm

Hello, I am working with Sybase PowerBuilder 9.0 and have to pull out
a series of contracts that have an expiration date within one year of
their start date.

Here is the query I'm using, but I keep getting an error. The
contract number is in a different table than the contract_start and
contract_end field.

select l.contract_number,
b.contract_start,
b.contract_end

from h_link l,
contract_header b,

where l.cust__t = b.cust__t


and ((b.contract_end > b.contract_start)
and (b.contract_end < (DATEADD(year, 1, b.contract_start))))

order by l.contract_number;

Any ideas? Should I use the BETWEEN instead?

Thanks in Advance,
Shahryar
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com