CoSpringsGuy
IS-IT--Management
My table stores statistics and has two fields to use for dates. year (numeric field) and month (text field)
I have no idea why they decided to store like this but thats what I have to work with. I have a report where a user enters a Through Date parameter and I need to return the previous 12 months data. I created code that works but I cant help to think that someone has created something a bit cleaner. Any thoughts?
//
({Clnt_Stats_MTD.FOUR_DIGIT_YEAR}=year({?Through Date})
and tonumber({Clnt_Stats_MTD.STAT_MONTH})in [month({?Through Date}) to 1])
or
({Clnt_Stats_MTD.FOUR_DIGIT_YEAR}=year({?Through Date})-1
and tonumber({Clnt_Stats_MTD.STAT_MONTH})in [month({?Through Date})+1 to 12])
_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection
I have no idea why they decided to store like this but thats what I have to work with. I have a report where a user enters a Through Date parameter and I need to return the previous 12 months data. I created code that works but I cant help to think that someone has created something a bit cleaner. Any thoughts?
//
({Clnt_Stats_MTD.FOUR_DIGIT_YEAR}=year({?Through Date})
and tonumber({Clnt_Stats_MTD.STAT_MONTH})in [month({?Through Date}) to 1])
or
({Clnt_Stats_MTD.FOUR_DIGIT_YEAR}=year({?Through Date})-1
and tonumber({Clnt_Stats_MTD.STAT_MONTH})in [month({?Through Date})+1 to 12])
_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection