change '2007-05-10' to current date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bb nicole
    New Member
    • Jan 2007
    • 127

    change '2007-05-10' to current date

    $sql = select bc_id,company_l ogin,from_unixt ime(bc_time) as bc_time,bc_stat us,bc_total_sen t_out,bc_actual _sent_out
    from broadcast
    where left(from_unixt ime(bc_time),10 )='2007-05-10'
    and bc_status in (2,3)
    order by bc_time asc

    above is my query for a project,
    where left(from_unixt ime(bc_time),10 )='2007-05-10'
    how to change '2007-05-10' to current date in same format(yyyy-mm-dd) so i no need to change it manually everytime....

    thankx...
  • pradeep kaltari
    Recognized Expert New Member
    • May 2007
    • 102

    #2
    Originally posted by bb nicole
    $sql = select bc_id,company_l ogin,from_unixt ime(bc_time) as bc_time,bc_stat us,bc_total_sen t_out,bc_actual _sent_out
    from broadcast
    where left(from_unixt ime(bc_time),10 )='2007-05-10'
    and bc_status in (2,3)
    order by bc_time asc

    above is my query for a project,
    where left(from_unixt ime(bc_time),10 )='2007-05-10'
    how to change '2007-05-10' to current date in same format(yyyy-mm-dd) so i no need to change it manually everytime....

    thankx...
    Hi,

    Try this:
    Code:
    where left(from_unixtime(bc_time),10)=DATE_FORMAT(CURRENT_DATE,'%Y-%m-%d')
    I guess this is what you are looking for.

    Regards,
    Pradeep

    Comment

    • bb nicole
      New Member
      • Jan 2007
      • 127

      #3
      Yes, thats what i want, thanks a lot, Pradeep...... :)


      Originally posted by pradeep kaltari
      Hi,

      Try this:
      Code:
      where left(from_unixtime(bc_time),10)=DATE_FORMAT(CURRENT_DATE,'%Y-%m-%d')
      I guess this is what you are looking for.

      Regards,
      Pradeep

      Comment

      Working...