Facebook Twitter RSS
banner

Return Even and Odd Records by Date in SQL

     
             The Syntax is:

                              update table_name set column_name=GETDATE()


                           Above query will return all records with same current date.
                                   

             The Syntax is:

             update table_name set column_name=dateadd(day,1,GETDATE())where id_Student%2=0
               
            The Result will be:
                                       

     Above query will return odd records by current date and even records by next date.

SHARE THIS POST

  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati

0 comments: