Hi
New to the forum and new to Crystal Reporting - I know this question isn't entirely about Crystal reports but can anyone help - I have put a formula in Crystal using the DATEADD function to calculate due dates of debtors based on the payment terms. This is fine in Crystal but I wondered - does anyone now how to get this formula into SQL so I can import the SQL view to excel rather than export the crystal report to excel.
the formula is as follows:-
if{ArInvoice.TermsCode} = "01" then dateadd('m',3,{ArInvoice.InvoiceDate}) - day(dateadd('m',3,{ArInvoice.InvoiceDate})) else if{ArInvoice.TermsCode} = "10" then dateadd('m',2,{ArInvoice.InvoiceDate}) - day(dateadd('m',2,{ArInvoice.InvoiceDate})) else if {ArInvoice.TermsCode} = "02" then dateadd("d",60,{ArInvoice.InvoiceDate}) else if {ArInvoice.TermsCode} = "03" then dateadd("d",30,{ArInvoice.InvoiceDate}) else if {ArInvoice.TermsCode} = "04" then {ArInvoice.InvoiceDate} else if{ArInvoice.TermsCode} = "9" then dateadd('d',(-(DAY(dateadd('m',1,dateadd('d',30,{ArInvoice.InvoiceDate}))))+15),dateadd('m',1,dateadd('d',30,{ArInvoice.InvoiceDate}))) else if {ArInvoice.TermsCode} = "12" then dateadd("d",90,{ArInvoice.InvoiceDate})
Thanks
juliesabre
|