Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Date criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chi - 28 Nov 2007 16:03 GMT
Hi,

I have two fields: StartDate and EndDate. I would like my qry to pull out
all students who are at my class  between StarDate and EndDate that I supply
as parameter.

Ex:
                   StartDate       EndDate
 Student 1     01/15/07         12/15/07
 Student2      02/16/07         05/01/08
 Student3      04/01/06         04/01/07
 Student4      01/01/06         01/14/07
   
If I enter StartDate: 01/15/07 and EndDate: 12/15/07, I would like to have  
student1 , student 2 and student 3 since either their StartDate or EndDate
fall between these dates ( between 01/15/07 and 12/15/07), but not student 4
since his StartDate and EndDate is not between 01/15/07 and 12/15/07.

Would you please help me on the criteria?

Thanks
Chi
Ofer Cohen - 28 Nov 2007 16:07 GMT
Try something like

Select * From TableName Where
StartDate Between [Please enter start date] And [Please enter end date]
Or EndDate Between [Please enter start date] And [Please enter end date]

The same criteria under each of the date fields with Or
Signature

Good Luck
BS"D

> Hi,
>
[quoted text clipped - 18 lines]
> Thanks
> Chi
Chi - 28 Nov 2007 16:33 GMT
Hi Ofer,

Would you please tell me more detail. Sorry, I don't know where " * From
TableName Where .........." is.  

Thanks
Chi

> Try something like
>
[quoted text clipped - 26 lines]
> > Thanks
> > Chi
KARL DEWEY - 28 Nov 2007 19:55 GMT
It is a SQL statement.   Open query in design view, click on menu VIEW - SQL
View and it opens another window to display the SQL language of the query.
SELECT *   ----   select all field of the table.
FROM TableName  ---  tells the query the source of data - table, query, etc.
WHERE  ---  states the criteria of the query.
StartDate Between [Please enter start date] And [Please enter end date]
Or EndDate Between [Please enter start date] And [Please enter end date]

Signature

KARL DEWEY
Build a little - Test a little

> Hi Ofer,
>
[quoted text clipped - 34 lines]
> > > Thanks
> > > Chi
Chi - 29 Nov 2007 14:26 GMT
Good morning Karl,

I appreciate for your explanation. It is very helpful!!!!!!!!!!
Chi

> It is a SQL statement.   Open query in design view, click on menu VIEW - SQL
> View and it opens another window to display the SQL language of the query.
[quoted text clipped - 42 lines]
> > > > Thanks
> > > > Chi
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.