run an query

Reply

Join Date: Oct 2006
Posts: 75
Reputation: welbyobeng is an unknown quantity at this point 
Solved Threads: 0
welbyobeng welbyobeng is offline Offline
Junior Poster in Training

run an query

 
0
  #1
Dec 20th, 2008
I have a table called "users", in the table it contain a column/ field name "reg_date" how would i run an query to say: For all the users, if their feild "reg_date" is blank put "20th December 2008"
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: manish.s is an unknown quantity at this point 
Solved Threads: 1
manish.s manish.s is offline Offline
Newbie Poster

Re: run an query

 
0
  #2
Dec 21st, 2008
please let me know the data type of field "reg_date".
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 75
Reputation: welbyobeng is an unknown quantity at this point 
Solved Threads: 0
welbyobeng welbyobeng is offline Offline
Junior Poster in Training

Re: run an query

 
0
  #3
Dec 21st, 2008
varchar(32)
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: manish.s is an unknown quantity at this point 
Solved Threads: 1
manish.s manish.s is offline Offline
Newbie Poster

Re: run an query

 
0
  #4
Dec 21st, 2008
  1. SELECT user_id,user_name,if(reg_date="","20th December 2008",reg_date) as 'Reg. Date' FROM users
  2.  
  3. WHERE user_id = UNIQUE User ID
  4. user_name = Store User Name
Last edited by peter_budo; Dec 21st, 2008 at 5:14 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC