jamesflowers1974
MIS
hi
I have a sql statement that extracts from our system all the names , addresses and dates of tenancy for a client.
Based upon that tenancy date , I have to write a letter to him informing of certain events.
ie if tenancy is 4.5 years old , in next six months they are due a kitchen refurb.
we have the wording of the letter in a database field , and based upon the timescale a different worded letter is sent.
how can I link the length of time from a sql statement
ie select DOT , (trunc(sysdate) - TRUNC(DOT)) as days from x
x can be banded from 0-30 , 31-60 , 61-180 , 181+
days as a guide to which text should be returned .
TIA
James
I have a sql statement that extracts from our system all the names , addresses and dates of tenancy for a client.
Based upon that tenancy date , I have to write a letter to him informing of certain events.
ie if tenancy is 4.5 years old , in next six months they are due a kitchen refurb.
we have the wording of the letter in a database field , and based upon the timescale a different worded letter is sent.
how can I link the length of time from a sql statement
ie select DOT , (trunc(sysdate) - TRUNC(DOT)) as days from x
x can be banded from 0-30 , 31-60 , 61-180 , 181+
days as a guide to which text should be returned .
TIA
James