?
Solved

MS Access excluding weekends in graph

Posted on 2016-09-03
5
Medium Priority
?
67 Views
Last Modified: 2016-09-04
Dear Experts,

Is it possible to exclude weekends in a chart. I have a bar chart with dates on the x axis. The data is school data and students do not meet on he weekend so I alway have those two day blank each week taking up space in the chart.

How do exclude weekend dates?
0
Comment
Question by:shogun5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 41782878
Create a query that excludes Weekend days (1 and 7), using the WeekDay function:

SELECT * FROM SomeTable WHERE WeekDay(SomeDateField) =2 OR Weekday(SomeDateField)=3 etc etc

You could also do:

SELECT * FROM SomeTable WHERE WeekDay(SomeDateField) >1 AND Weekday(SomeDateField)<7
0
 

Author Comment

by:shogun5
ID: 41782902
Scott,

Thanks! So I tried this on the record source of the Chart and it worked in the sense that data is not showing up on Sat and Sun but how to I remove those dates from showing up on the x axis of the access chart?  right now I have Sat and Sun for each week but no data.

Thanks!
0
 
LVL 85
ID: 41783724
Depends on what sort of Chart you created, and how you created it, but essentially just recreate the chart using the query you built earlier.
0
 

Author Comment

by:shogun5
ID: 41783735
Scott,

Here's the thing... when I use the SQL you provided the weekends are excluded in the query but when I display the value in the chart I still get Saturday and Sunday date but without data.
using sql
However, when I remove the SQL statement the data shows up:
without sql
So I guess what I am seeking is a way to not have the weekends show up on the x axis of the chart. Is that even possible?
0
 
LVL 85
ID: 41783788
I'm not quite sure I follow you ...

When you create a chart in Access, you're asked to choose a Table or Query on which to base your chart. If you do that, and choose the query that excludes weekend dates, your resultant chart should show only the values in your query (i.e. the WeekDays).

Or perhaps I'm missing something.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question