Jump to content

Pull records from start of Fiscal Year?


Moron

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.
Link to comment
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]";
Link to comment
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.
Link to comment
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.

:)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.