Jump to content


Regarding one Query with CURDATE and INTERVAL


1 reply to this topic

#1 jimjack14

    Newbie

  • Members
  • Pip
  • 0 posts

Posted 27 March 2008 - 09:13 AM

Hi All,

I am here new for this forum. Currently I am working on project in that has 140 tables.

One company already builds project. However, I want to create on page with link of PHP and MYSQL database. It’s a project of In and Out time of employee. Right now every one have separate logins to insert IN and OUT time. In one single table they are inserting their IN/ OUT time. Table name is ‘punch’. My requirement is below:

Want to create a page where I can display every one In / Out Time for present day and previous six days in / Out time data.

For above requirement first I tried to retrieve current date via CURDATE() function.

I used below query:
SELECT `actual_time_stamp` FROM `punch` WHERE `created_by` = '11'
AND actual_time_stamp LIKE '%CURDATE()%';

But I am not getting any result. Can u help how would I get data for present date and previous six-day data via use of interval of days.

Any suggestion and idea is welcome.

Regards,
Jitu

#2 lampchaitanya

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 14 July 2009 - 09:27 AM

CURDATE() gives todays date

no need to use like fuction use date=CURDATE()





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users