Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-13-2019, 08:46 AM   #1
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
greater than without using ">"

hi guys, i have this Hard Question that i have to solve and submit it today

ti's about this database

i want to see all employees who have salary more than “Saleh’s salary”. with out USE “>21,450”
Because Salah's salary can change in the future

Thanks in advance
Attached Images
File Type: png access11.png (34.4 KB, 25 views)

aqeelh is offline   Reply With Quote
Old 02-13-2019, 08:53 AM   #2
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 3,672
Thanks: 398
Thanked 637 Times in 618 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: greater than without using ">"

Don't hard code values, then it does not matter what salary Salah has.
__________________
Access novice. Sometimes trying to give something back.
Access 2007


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 02-13-2019, 08:54 AM   #3
theDBguy
I’m here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,063
Thanks: 36
Thanked 732 Times in 715 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: greater than without using ">"

Hi. Is this a homework assignment? Your topic title says without using ">," but I think you can't avoid that if you want to know greater than values. I think it's more like you don't want a fix value like 21,450, which means you should be able to use >[Salary].

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by theDBguy; 02-13-2019 at 08:54 AM. Reason: too slow...
theDBguy is offline   Reply With Quote
Old 02-13-2019, 09:02 AM   #4
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
Re: greater than without using ">"

yes it is assignment, and i don't konw how to do it.
aqeelh is offline   Reply With Quote
Old 02-13-2019, 09:07 AM   #5
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
Re: greater than without using ">"

Quote:
Originally Posted by Gasman View Post
Don't hard code values, then it does not matter what salary Salah has.
so what should i do?
aqeelh is offline   Reply With Quote
Old 02-13-2019, 09:13 AM   #6
theDBguy
I’m here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,063
Thanks: 36
Thanked 732 Times in 715 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: greater than without using ">"

Hi. Since we are not familiar with the requirements of the assignment, it might be faster to get an answer if you asked one of your classmates. If you need help from us, we'll need to see what you've tried, so we can help you fix it. Can you tell us the stated goal for the homework? Thanks.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 02-13-2019, 09:28 AM   #7
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
Re: greater than without using ">"

Quote:
Originally Posted by theDBguy View Post
Hi. Since we are not familiar with the requirements of the assignment, it might be faster to get an answer if you asked one of your classmates. If you need help from us, we'll need to see what you've tried, so we can help you fix it. Can you tell us the stated goal for the homework? Thanks.
as i know there is no one solve it until now, the assignment is like A set of questions about how to create queries, i did a lot but i doesn't related to this question.

aqeelh is offline   Reply With Quote
Old 02-13-2019, 09:31 AM   #8
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 1,863
Thanks: 17
Thanked 353 Times in 350 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: greater than without using ">"

Can you create a query of everyone who has a salary equal to or less than the selected employee's salary?

Can you create a second query that includes all employees EXCEPT those in the first?
Mark_ is offline   Reply With Quote
Old 02-13-2019, 09:38 AM   #9
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 3,672
Thanks: 398
Thanked 637 Times in 618 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: greater than without using ">"

You could use a subquery.?

https://support.office.com/en-gb/art...1-951de6e94e2a
__________________
Access novice. Sometimes trying to give something back.
Access 2007


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 02-13-2019, 09:40 AM   #10
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
Re: greater than without using ">"

Quote:
Originally Posted by Mark_ View Post
Can you create a query of everyone who has a salary equal to or less than the selected employee's salary?

Can you create a second query that includes all employees EXCEPT those in the first?

yes i can, hmmmm
aqeelh is offline   Reply With Quote
Old 02-13-2019, 09:42 AM   #11
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,307
Thanks: 153
Thanked 1,690 Times in 1,662 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: greater than without using ">"

Put the first query in the second query in the designer .

Mess around with joins and Is Null criteria.

If the world stops spinning you know you broke the interwebs.
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 02-14-2019, 01:07 AM   #12
George21
Newly Registered User
 
Join Date: Jan 2011
Location: Piraeus, Greece
Posts: 27
Thanks: 1
Thanked 5 Times in 5 Posts
George21 is on a distinguished road
Re: greater than without using ">"

Will Saleh be a constant (meaning the criteria won't be changed in the future)? If so, create a query based on the table and in the emp_salary criteria write foll:

>DLookup("emp_salary","emp_table","emp_id = 8")
George21 is offline   Reply With Quote
Old 03-19-2019, 06:08 AM   #13
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
Re: greater than without using ">"

Quote:
Originally Posted by George21 View Post
Will Saleh be a constant (meaning the criteria won't be changed in the future)? If so, create a query based on the table and in the emp_salary criteria write foll:

>DLookup("emp_salary","emp_table","emp_id = 8")
no the salary it might be changed
aqeelh is offline   Reply With Quote
Old 03-19-2019, 06:11 AM   #14
aqeelh
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
aqeelh is on a distinguished road
Re: greater than without using ">"

i think i have to work with Nested Queries but how i write criteria without writing employee's salary
aqeelh is offline   Reply With Quote
Old 03-19-2019, 06:15 AM   #15
plog
AWF VIP
 
Join Date: May 2011
Posts: 9,285
Thanks: 10
Thanked 2,251 Times in 2,203 Posts
plog is a jewel in the rough plog is a jewel in the rough plog is a jewel in the rough
Re: greater than without using ">"

Quote:
no the salary it might be changed
No, he didn't ask that. He asked if Saleh was the constant in the equation, not Saleh's salary. My opinion is you totally botched the purpose of this assignment and focused on the '>' part when the real part the teacher wanted you to avoid was the '21450'.

George21 provided the correct solution.

plog is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query with multiple conditions "greater than" ilcaa72 Queries 2 07-07-2017 04:57 PM
Input " Like A* " in Validation Rule Property but it shows " ALike "A*" " AccessPractice Tables 2 06-24-2016 05:37 AM
If "TableA.FieldA" exists in "TableB.FieldB" then return "1" else "2" shdale Queries 8 10-29-2014 05:20 AM
Evaluating if date is greater than "x" days from now TimTDP Modules & VBA 2 03-19-2013 02:00 AM
"The section is greater than page width..." Iasthaai Reports 14 03-05-2010 08:54 AM




All times are GMT -8. The time now is 03:34 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World