Solved

MS Access excluding weekends in graph

Posted on 2016-09-03
5
55 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 84

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 84
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 84
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

730 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