Jump to content

Archived

This topic is now archived and is closed to further replies.

Moron

Pull records from start of Fiscal Year?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
How is the date stored in your database table?

Share this post


Link to post
Share on other sites
[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]";

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites
[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.

:)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.