473,585 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sort query by calculated field

Please help!

I am trying to sort a query by a field calculated as e.g.
[hoursabsent]/[hoursworked]

I keep getting an error about subqueries not allowed for this type of
expression, but only when I set to sort.

I can sort by another calculated field of, for example just
sum([hoursworked]), but not [hoursabsent]/[hoursworked] and not
[hoursworked] + [hoursabsent]

is there something in SUM() that allows me to sort? Can I enclose
[hoursabsent]/[hoursworked] in a similar function to allow it to sort?

any ideas?

thank you

Oct 16 '06 #1
1 2331
Nelly wrote:
Please help!

I am trying to sort a query by a field calculated as e.g.
[hoursabsent]/[hoursworked]

I keep getting an error about subqueries not allowed for this type of
expression, but only when I set to sort.

I can sort by another calculated field of, for example just
sum([hoursworked]), but not [hoursabsent]/[hoursworked] and not
[hoursworked] + [hoursabsent]

is there something in SUM() that allows me to sort? Can I enclose
[hoursabsent]/[hoursworked] in a similar function to allow it to sort?

any ideas?

thank you
Answered in microsoft.publi c.access. Please do not multipost (send the
same message separately to more than one group). If necessary, you may
crosspost (post a single message at once to a few groups). Not only does
this help you see the answers, it helps us focus our effort on your
question in a single thread.

--
Smartin
Oct 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4973
by: Steve | last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's criteria is set ats: Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the selections are 30, 60 and 90. The default is set at 30. Question1: When the form opens, there are no records displayed although there are many records that fit the...
3
7025
by: Bill Clark | last post by:
I have about 20,000 records pulled from Excel that I need to update. What I need to do is run an update query that bascially says: If a field is null, update it with the previous record value of that same field. In some instances, it will have to go back a few records before it finds a value that is not null. Can this be done? Thanks ...
3
8508
by: jdph40 | last post by:
I've been given a database and asked to figure out how to sort a report. The report needs to be sorted on a field that is the sum of a field that is calculated in the underlying query. NetSales is calculated in the query; the control source of the text box on the report is Sum(). I need to sort on this. I tried going to the query and...
1
2327
by: Norbert Lieckfeldt | last post by:
MS Access 2002 here. I am just trying to set up a simple database for a friend who's an optician. Basically, all clients with address details, date of last eyetest and a drop-down combo box to choose a number of months to the next eyetest (3,6,12,24). I then have a calculated field in the form which works out the date of the next appointment...
2
6507
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result. I then want to search through the records and select those with dates (as caluclated above) within a user defined range, and so I am using a...
7
3323
by: Arnold | last post by:
Greetings Gurus, In a mainform's header, I have a combobox named comboStudents. The rowsource for this combobox is: SELECT -999 As StudentID, "<Add New Student>" As FullName, "aaa" As LastName, "x" As FirstName From qryStudents UNION SELECT StudentID, FullName, LastName, FirstName FROM qryStudents ORDER BY LastName;
9
3043
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped. Below you will find the code I've written and the error that results. I'm hoping that someone can give me some direction as to what syntax or...
10
6217
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this cross-tab query I am using a simple query with no grouping where I am filtering some data out in the criteria line. I have been out of access for...
3
6005
by: myemail.an | last post by:
I use Access 2007 and create queries with a number of calculated fields/expressions (I'm still a novice so please forgive me if my wording is imprecise...), like: MyCalculation = Field1 - Field2. However, I noticed that I cannot query the database setting a condition on this newly created field (eg <0); if I do, when I run the query ,...
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.