473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem in Date selection

83
Hi
I am working in mysql database system, i want to select the some fields with the date. For Example in a company employers details are stroed the is name, dateofjoin, age, Address etc. I want to select the particular employer those are joing in from date 'somedate' to 'somedate' .

mysql is
Expand|Select|Wrap|Line Numbers
  1.  create table emp_join(name varchar(20),join_date date,age int);
  2.  
  3. +------+------------+------+
  4. | name | join_date  | age  |
  5. +------+------------+------+
  6. | sang | 2007-03-04 | 21   |
  7. | xxx  | 2006-05-06 | 23   |
  8. | yyy  | 2006-04-07 | 24   |
  9. | zzz  | 2006-12-12 | 21   |
  10. +------+------------+------+
  11.  
  12.  
From the above table i want to select the person who are join in the date (ie is the joing date is from 2006-05-06 to 2007-06-05

the result is displayed like this

sang
xxx

Please give the query to select the date 'fromdate' to 'todate'

Thanks and regards,
Sang
Aug 16 '07 #1
1 1128
dodjem
3
You want something like this below?
Expand|Select|Wrap|Line Numbers
  1. SELECT name FROM emp_join WHERE join_date BETWEEN 'fromdate' AND 'todate';
or
Expand|Select|Wrap|Line Numbers
  1. SELECT name FROM emp_join WHERE join_date >= 'fromdate' AND join_date <= 'todate';
You just need to make sure that the fromdate and todate are in the correct date datatype format
Aug 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dave Mann | last post by:
Right i have tried but failed! I have a Form and a subform Fields in Sub form are:- Planned - Checkbox Unplanned - Checkbox Maint Type - Dropdown selection Date Done Description
1
by: piet | last post by:
I have created a continues form, based on a query. In the header, there are some comboboxes that gives the user the possibility to make certain selections. Everytime a selection is made on a...
1
by: graemeharnish | last post by:
Hello. I'm trying to mod an open source app called TinyERP and inherit from a parent object, and in essence change how _column is defined. I found sample code of: class...
8
by: sara | last post by:
I have a report that runs fine with data. If there is no data, I have its NO Data event sending a MsgBox and cancelling the report. Then it seems I still get the 2501 message on the Open Report...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
0
by: GiftX | last post by:
VB 6.0 And Spreadsheet - Printing problem Good morning West. After much research, I found this code. It scans the spreadsheet and returns up to the last used cell. ...
0
ilikepython
by: ilikepython | last post by:
Hello, I'm trying to use visual basic to automatically write headers. Something like this: <my name> <class> <date> <my <class>'s teacher's name>...
1
by: eskelies | last post by:
Below you will find the code that I have written. I am asking it to search for an Excel file. Once it finds the correct dated Excel file it opens it. From there it is in search of information. I...
5
by: =?Utf-8?B?bWFib25k?= | last post by:
Hi Using a month calendar control so that my user can select a start and end date for a range that will be used in a SQL query. Problem.....if user selects a date in one month and then scrolls...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.