Must be the 31st - (add to FAQ)
Posted in 1996
Some of you will run into this today..... SELECT TODAY - 1 UNITS MONTH fails - invalid date - 6-31-96 The user in question was interested in the month portion of this so her query was: SELECT MONTH(TODAY) - 1 UNITS MONTH which also failed. I showed her: SELECT MONTH(TODAY - DAY(TODAY) UNITS DAY) which works, except... What she REALLY wanted: SELECT EXTEND(TODAY - DAY(TODAY) UNITS DAY), YEAR TO MONTH) Which yields the year portion as well - sort of vital come January or when you have more than 1 years worth of data. cheers j. _____________________________________________________________________________ Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA jparker@boi.hp.com Currently on loan to PLD/PE _____________________________________________________________________________ If anything can go wrong, fix it. To hell with Murphy. _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________