Jump to content


Photo

Pull records from start of Fiscal Year?


  • Please log in to reply
5 replies to this topic

#1 Moron

Moron
  • Members
  • PipPipPip
  • Advanced Member
  • 368 posts

Posted 14 August 2006 - 03:05 PM

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.


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:10 PM

How is the date stored in your database table?
Legend has it that reading the manual never killed anyone.
My site

#3 Moron

Moron
  • Members
  • PipPipPip
  • Advanced Member
  • 368 posts

Posted 14 August 2006 - 03:14 PM

How is the date stored in your database table?


By Month, Day, Year. I also wrote a function that combines these...

$combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]";

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:30 PM

How is the date stored in your database table?


By Month, Day, Year. I also wrote a function that combines these...

$combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]";


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.
Legend has it that reading the manual never killed anyone.
My site

#5 Moron

Moron
  • Members
  • PipPipPip
  • Advanced Member
  • 368 posts

Posted 14 August 2006 - 03:52 PM

How is the date stored in your database table?


By Month, Day, Year. I also wrote a function that combines these...

$combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]";


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.


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.

:)

#6 Moron

Moron
  • Members
  • PipPipPip
  • Advanced Member
  • 368 posts

Posted 14 August 2006 - 05:16 PM

Anybody?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users