Solved

MS Access excluding weekends in graph

Posted on 2016-09-03
5
38 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
  • 3
  • 2
5 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now