Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to split date from time... 1

Status
Not open for further replies.

blondends

Technical User
Apr 25, 2003
84
GB
Hi,

I have a field in a MySQL database that h holds the now() function data. But i want to check to see if the field in the database matches today date. This dosen't happen becuase if i do....

if field = date() then..

it checks the time part too and so there for is isn't equal. What i need to do is split the date from the time and check against the date only. Anybody have any ideas ?

Cheers


Chris
 
Brute force method:
Code:
If Day(field)=Day(Date()) And Month(field)=Month(Date()) _
And Year(field)=Year(Date()) Then ...

Hope This Help
PH.
 
Yeah cheers for the quick reply. It does help alot, i was thinking along the lines for a pre-built function that would do it for you. Thanks again !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top