Home

Products
>SQL Wizard | Access Add-in
>Data Change Analyzer| Access
Add-in

>Consolidate & Update Wizard | Access Add-in
>Median Finder | Access Add-in
>111+ Power Access Queries/SQLs
>Duplicates Finder | Access Add-in
>Duplicates Filter | Excel Add-in
>Excel Tips & Tricks

>Macros Finder | Excel Add-in


 

111+ Power Access Query/SQL Examples

[Go To Part 1]

Part 2 | 20 Date-Related Queries

Database B (DateWizard.mdb) contains 20 main queries.

These 20 queries meet almost all of your needs related to dates. All of these queries are parameter queries. In a datasheet view, you can run the query again by hitting the F9 key while holding down the shift key; there is no need for you to start all over by closing the query and opening it again.

When you open this database, a user interface form pops up. You can use this form to open one of the 18 main queries at a time.

_______________

_______________

_______________

The description of the 18 main queries is as follows:

1. Particular Weekdays in Each Month of a Given Year
Parameters required: year, weekday number (1-7)
Example: a list of all Wednesdays in 2007

_______________

2. Last Particular Weekday in Each Month of a Given Year
Parameters: year, weekday number (1-7)
Example: A list of last Fridays in each month of 2007

_______________

3. Nth Particular Weekdays in a Given Year
Parameters: Year, weekday number (1-7)
Example: A list of 4th Monday in each month of 2008

_______________

4. Every Other Particular Weekdays in a Given Year
Parameters: year, weekday number (1-7)
Example: A list of every other Thursday in 2007

_______________

5. Count of Weekdays by Month
Parameters: year
Example: A count of weekdays in each month of 2007

_______________

6. Month-end Dates in a Given Year.
Parameters: year
Example: A list of 12 month-end dates in 2007

_______________

7. Number of a Particular Weekday between Two Dates
Parameters: start date, end date, weekday number (1-7)
Example: The number of Tuesday from 04/15/07 to 11/18/07

_______________

8. First Particular Weekday Following a Given Date
Parameters: weekday number (1-7), date
Example: 5/16/07 is the first Wednesday after 5/12/07

_______________

9. Number of Years between Two Dates
Parameters: first date, second date
Example: From 2/25/06 to 09/15/12, it is six years

_______________

10. How Old Am I Today?
Parameters: date (DOB)
Example: If your birth date is 7/25/76, you are 30 years old as of today (4/15/07)

_______________

11. Is It a Leap Year?
Parameters: year
Example: If the year is 2008, it is a leap year

_______________

12. USA Holidays in a Given Year
Parameters: year
Example: A list of ten Federal holidays in 1998

_______________

13. USA Holidays in the Current Year
Parameters: year
Example: A list of ten Federal holidays in 1997

_______________

14. USA Holidays (observed) in a Given Year
Parameters: year
Example: A list of ten Federal holidays as they are observed in 2008
Note: If a holiday falls on Saturday, it is observed on the preceding Friday.
If the holiday falls on Sunday, it is observed on the following Monday.

_______________

15. USA Holidays in Multi Years
Parameters: You can enter whatever years you want in a table.
Example: A list of ten Federal holidays in 2006,2007,2008

_______________

16. USA Holidays (observed) in Multi Years
Parameters: You can enter whatever years you want in a table.
Example: A list of ten Federal holidays as they are observed in 2007,2008, 2009
Note: If a holiday falls on Saturday, it is observed on the preceding Friday.
If the holiday falls on Sunday, it is observed on the following Monday.

_______________

17. Working Days in USA in a Given Year.
Parameters: year
Example: A list of weekdays excluding weekends as well as the ten Federal holidays in 2008.

_______________

18. Working Days Over Next N Days
Parameter: A number of days
Example: A list of working days over next 1000 days excluding weekends

_______________

19.  How many work days over next N days?
Parameter 1: N days
Parameter 2: From
Example: There are 72 workdays over next 100 days from 05/15/07.

_______________

20. Count Weekdays between Two Dates

Parameter 1: Start Date
Parameter 2: End Date

 

(includes both Part 1 and Part 2)


[Go To Part 1]


We offer an unconditional 30-day Money Back Gurantee and free e-mail support! Your order is secured via RegNow SSL Secure Server (see RegNow Security/Privacy statement). You will be able to download the product immediately after ordering!

Copyright © 2010 MrSpreadsheet, LLC. All rights reserved.
Excel, Access are registered trademarks of the Microsoft Corporation.