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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting records acccording to dates from two tables lying in a range

Status
Not open for further replies.

addygoyal

Programmer
Apr 24, 2003
21
ZA
i ve got tables creditnote.table and invoice.table.which are linked with each other by a coomon field.
They have date fields {INVOICE.INV_INVOICE_DT} And {CreditNote.INV_CreditNote_DT}.
ive to select records according to whether these dates lie in a particular range ie between parameter dates ?CP_FromDate and ?CP_ToDate.
i can use the following formula

(date{INVOICE.INV_INVOICE_DT}) >= date({?CP_FromDate}))
and ( date({TTM_INVOICE.INV_INVOICE_DT}) <= date({?CP_ToDate} ))
or (date{CreditNote.INV_CreditNote_DT}) >= date({?CP_FromDate}))
and ( date({TTM_CreditNote.INV_CreditNote_DT}) <= date({?CP_ToDate} ))

this will give me the values where credit note records and invoice records lie in the date ranges but will also give me the records where creditnote.date lies in the range but invoice.date does not lies and vice versa whereas i want only those records where only invoice.date lies in the range and only where creditnote.date lies in the range.
I cantb use subreports because i am gruping these for a particlar Field.
So hopin you turn up with something
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top