473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

grouping field to calcuate percentage

Hi,

i want to create a Ms Access query such that it will auto calculate its percentage out.

For example,
i have Field: (lead time between order date and invoice date). i want to calculate how many of them fall within 0-7 days, 7-14 days and >14 days. in percentage.

please help.
Jun 25 '07 #1
3 1748
NeoPa
32,556 Expert Mod 16PB
Assuming fields in your table of [OrderDate] & [InvoiceDate] you can firstly have a query that includes fields that show which group they fall under :
Expand|Select|Wrap|Line Numbers
  1. SELECT [OrderDate],
  2.        [InvoiceDate],
  3.        IIf(DateAdd('d',7,[OrderDate])>[InvoiceDate],
  4.            '1 Week',
  5.            IIf(DateAdd('d',14,[OrderDate])>[InvoiceDate]),
  6.                '2 Weeks',
  7.                '>2 Weeks')) AS [DaysTaken]
  8. FROM [YourTable]
Jun 25 '07 #2
Assuming fields in your table of [OrderDate] & [InvoiceDate] you can firstly have a query that includes fields that show which group they fall under :
Expand|Select|Wrap|Line Numbers
  1. SELECT [OrderDate],
  2.        [InvoiceDate],
  3.        IIf(DateAdd('d',7,[OrderDate])>[InvoiceDate],
  4.            '1 Week',
  5.            IIf(DateAdd('d',14,[OrderDate])>[InvoiceDate]),
  6.                '2 Weeks',
  7.                '>2 Weeks')) AS [DaysTaken]
  8. FROM [YourTable]

Hi,

thx for your reply,
i already have a query with field that calulate the lead time.
So, how do i have another query which show me the percentage which shows lead time
1) less than 7 days
2) 7-14 days
3) more than 7 days?
Jun 26 '07 #3
NeoPa
32,556 Expert Mod 16PB
How about you post the SQL of the query that you would like me to work from.
Jun 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Darren | last post by:
I have a report with one level of grouping and a running sum field in the detail section of the report. When I make the running sum field visible, I can see that it increases the count by 1 for...
1
by: Brian Coy | last post by:
I am creating a database to track scrap on a daily basis at my plant. I have to provide a weekly scrap report with the amount of each part scrapped per day. I have the basic database set up, and...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
4
by: mantrid | last post by:
I have records from a database that are extracted with php and displayed in a table. Data in some of the fields is replicated eg something1,item1,somethingelse1 something1,item1,somethingelse2...
3
by: Jimmy | last post by:
Is there a way to sort/group a report based on the second column of a combo box, i.e. the text associated with the primary key number?
9
by: JakeTheSnake | last post by:
Hello, I'm new here, but am really impressed with the positive attitude! I was wondering if someone could give me some help or point me in the right direction. I have a query that returns the...
0
denny1824
by: denny1824 | last post by:
I have a crystal report that someone else wrote and already has a Formula Field if Criteria then (Count ({FirstField},{SecondField}) / Count ({FirstField})) When the Criteria is true, this...
12
kcdoell
by: kcdoell | last post by:
Hello: I just learned how to put crosstabs queries together but this one in particular is adding a new dimension in which I was hoping someone could give me some direction. I have the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.