943,722 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 623
  • MySQL RSS
Dec 20th, 2008
0

run an query

Expand Post »
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"
Similar Threads
Reputation Points: 13
Solved Threads: 0
Junior Poster in Training
welbyobeng is offline Offline
75 posts
since Oct 2006
Dec 21st, 2008
0

Re: run an query

please let me know the data type of field "reg_date".
Reputation Points: 10
Solved Threads: 5
Light Poster
manish.s is offline Offline
29 posts
since Dec 2008
Dec 21st, 2008
0

Re: run an query

varchar(32)
Reputation Points: 13
Solved Threads: 0
Junior Poster in Training
welbyobeng is offline Offline
75 posts
since Oct 2006
Dec 21st, 2008
0

Re: run an query

sql Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 5
Light Poster
manish.s is offline Offline
29 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Display mysql data
Next Thread in MySQL Forum Timeline: Advanced SQL query problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC