Moron Posted August 14, 2006 Share Posted August 14, 2006 Our Fiscal year begins July 1. I want to pull records from that date forward and I also need it to understand calendar year changeover. In other words, next February 2007, I want it to understand that the Fiscal Year started July 1, 2006. Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 How is the date stored in your database table? Quote Link to comment Share on other sites More sharing options...
Moron Posted August 14, 2006 Author Share Posted August 14, 2006 [quote author=AndyB link=topic=104212.msg415475#msg415475 date=1155568207]How is the date stored in your database table?[/quote]By Month, Day, Year. I also wrote a function that combines these...$combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]"; Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 [quote author=Moron link=topic=104212.msg415479#msg415479 date=1155568481][quote author=AndyB link=topic=104212.msg415475#msg415475 date=1155568207]How is the date stored in your database table?[/quote]By Month, Day, Year. I also wrote a function that combines these...$combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]";[/quote]Oh, Lord! It would make your life so much simpler if you stored the date using a single database field using the date format (yyyy-mm-dd). Then manipulations like the selection you want would be a zillion times simpler. Unless you are absolutely committed to your own unique date storage method, I'd really recommend you change it to yyyy-mm-dd since that will make lots of sorting/retrieving by date much simpler - and I expect you'll have more of them in the future - otherwise you're in for lots of coding headaches.If your concern is how 'difficult' it is to get people to enter dates in that format, use a simple, human-friendly, javascript date picker to do it for them. Quote Link to comment Share on other sites More sharing options...
Moron Posted August 14, 2006 Author Share Posted August 14, 2006 [quote author=AndyB link=topic=104212.msg415493#msg415493 date=1155569450][quote author=Moron link=topic=104212.msg415479#msg415479 date=1155568481][quote author=AndyB link=topic=104212.msg415475#msg415475 date=1155568207]How is the date stored in your database table?[/quote]By Month, Day, Year. I also wrote a function that combines these...$combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]";[/quote]Oh, Lord! It would make your life so much simpler if you stored the date using a single database field using the date format (yyyy-mm-dd). Then manipulations like the selection you want would be a zillion times simpler. Unless you are absolutely committed to your own unique date storage method, I'd really recommend you change it to yyyy-mm-dd since that will make lots of sorting/retrieving by date much simpler - and I expect you'll have more of them in the future - otherwise you're in for lots of coding headaches.If your concern is how 'difficult' it is to get people to enter dates in that format, use a simple, human-friendly, javascript date picker to do it for them.[/quote]Heh heh! Trust me, I'm not committed to anything at all! I'm a total newbie at PHP and I'm struggling to get a program written. The problem is that this is an old database and it's all I have to work with. :) Quote Link to comment Share on other sites More sharing options...
Moron Posted August 14, 2006 Author Share Posted August 14, 2006 Anybody? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.