Re: [SQL] generated dates from record dates - suggestions

2012-08-21 Thread Gary Stainburn
On Tuesday 21 August 2012 12:14:53 Jasen Betts wrote: > > What's the best way to do this? > > CASE looks good. > > > I know it's a quite open question but I'm interested to hear different > > responses > > "date_b" on line three, is that a typo? if not how am i to interpret > it? The table contain

Re: [SQL] generated dates from record dates - suggestions

2012-08-21 Thread Jasen Betts
On 2012-08-20, Gary Stainburn wrote: > Hi folks. > > I've got a table with three dates which are populated from an external source. > I then want to have a view with two calculated dates in it, e.g. > > if date_1 is null and date_2 is null then date_a=NULL > if date_1 is not null and date 2 is nul

Re: [SQL] generated dates from record dates - suggestions

2012-08-21 Thread Gary Stainburn
On Tuesday 21 August 2012 02:01:55 Johnny Winn wrote: > I would define a function and use it to abstract the expected behavior. It > would appear that there are several conditions so this abstraction would > provide for both usability and maintainability. > > - Johnny Johnny, This was what I was