RE: SQL Date guru in the house?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: mwestern@xxxxxxxxxxx [mailto:mwestern@xxxxxxxxxxx] 
Sent: 11 May 2005 07:17
To: php-general@xxxxxxxxxxxxx
Subject:  SQL Date guru in the house?


Hi All,

I have a small problem.   

I have a project in which someone has got three integer fields for
holding the date.   DD, MM, YYYY in an sql database.    I now have to
have a page that inputs two dates and select records between those two
dates.     

If I had a date field in the table it would be fairly simple, but I'm
hoping to do this search/comparison without having to rewrite the
pages/database that has already been designed.

---------------------
I strongly recommend that you rewrite the application to use dates! Can
you at least add a column to the table which makes a datetime out of
those three fields? Then you can do your date comparisons easily. 

Which database are you using?


---------------------

Start Date:	11/05/2005
End Date:	11/04/2005
SELECT * FROM blah WHERE mm BETWEEN 04 AND 05 AND dd BETWEEN 11 AND 11
AND yyyy BETWEEN 2005 AND 2005

Doesn't work for obvious reasons.      Is there any way that I can do
this date comparison I the SQL statement without having a decent date
field? My apologies as this is australian date format and this list is
in the US I think? 
--------------------
No need to apologise - this list is on the internet and has posters from
all over the world
-------------------

Regards Matthew


Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY

**********************************************************************

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from http://www.gammaglobal.com

E&OE

**********************************************************************
**********************************************************************


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux