TechSpott

Go Back   TechSpott > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.
Reply
 
Thread Tools Display Modes
Old February 20th, 2010, 10:04 PM   #1 (permalink)
Jessica
TechSpott Newbie
 
Join Date: Feb 2010
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Jessica is an unknown quantity at this point
Default Fetching data from table

Hi,

I have a table consisting five columns Card No, Sdate, Edate, ATime, Etime

Now i want to get three columns info CardNo, Sdate, Edate from table. But i am facing problem when i get input from user to get their required info. For example user want to exact CRad name & his info from a specific Sdate to Edate.

Any effort will be appreciated .
Jessica is offline   Reply With Quote Share with Facebook
Old February 20th, 2010, 10:09 PM   #2 (permalink)
Neobux
Junior Member
 
Join Date: Feb 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Neobux is an unknown quantity at this point
Default

Quote:
Originally Posted by Jessica View Post
Hi,

I have a table consisting five columns Card No, Sdate, Edate, ATime, Etime

Now i want to get three columns info CardNo, Sdate, Edate from table. But i am facing problem when i get input from user to get their required info. For example user want to exact CRad name & his info from a specific Sdate to Edate.

Any effort will be appreciated .
Following might help.. If SDate and EDate are date type columns..

SELECT CardNo, SDate, EDate FROM table WHERE SDate > INPUT_DATE AND EDate < INPUT_DATE

Alternately better method is..

SELECT CardNo, SDate, EDate FROM table WHERE INPUT_DATE BETWEEN SDate AND EDate
Neobux is offline   Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
data, fetching, table


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 03:50 PM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO
Powered By DeTrax Media Co.