LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-15-2007, 01:59 AM   #1
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Rep: Reputation: 15
MYSQL extracting DATE value


+--------------+---------------+
| Value | Username |
+--------------+---------------+
| 31 August 2007 | mobile |
| 22 June 2008 | bbcnet |
| 21 August 2007 | balku |
| 21 August 2007 | rkmar |
| 21 August 2007 | sans |
| 1 June 2008 | kame |
| 20 July 2008 | yogh |
--------------------------- -----

Above is my mysql table structure, What I want to do is extract the username from the above list which will reach the above mentioned date in 5days.
For example today is 15 August 2007, I want to get username whose date is going to reach 21 august 2007 after 6 days.
Lets say after following will be user whose date will be 21 August 2007 after 6 days.

| 21 August 2007 | balku |
| 21 August 2007 | rkmar |
| 21 August 2007 | sans |
 
Old 08-16-2007, 01:20 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Check the mysql manual for date and time functions; I use the manual for version 3.23, 4.0 and 4.1 and in there it's chapter 12.5
You will probably end with something like
Code:
select whatevercolumn from whatevertable where whateverdatecolumn = curdate() + 6;
Hope you were clever enough to make the value column a date type, else it might not work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
selecting information by date in mysql trscookie Programming 4 07-21-2006 05:07 AM
Extracting MySQL data from raw files cs-cam Linux - Software 1 06-12-2006 11:22 PM
show date in mysql bentman78 Linux - Software 0 05-17-2004 11:44 AM
MySQL date format mnauta Linux - General 2 05-13-2004 06:20 PM
Changing date format in MySQL table vous Linux - Software 8 09-03-2003 06:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration