Solved

MS Access excluding weekends in graph

Posted on 2016-09-03
5
59 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

690 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