how to make a query with a critera max

mana

Registered User.
Local time
Today, 11:02
Joined
Nov 4, 2014
Messages
265
hello

i want to make a query and one of my criteria is that one of my fields will be less than of two textboxes in my form. can you help me please?
thank you
i attached the pic
 

Attachments

  • Unbenannt.jpg
    Unbenannt.jpg
    96.4 KB · Views: 138
There is info here, and an option to test some code (Try It).
 
hello
i attached the file
did ayou see it?
i want that in my query the creation date will be less than max of some values of some textboxes in one of my forms
i know macx function
 
No attached file.
Did you look at the info on w3schools?
 
yes i saw it
can you see the attach file now?
 

Attachments

  • Unbenannt.jpg
    Unbenannt.jpg
    96.4 KB · Views: 118
Did you try the materials at w3schools?

You can find all records using
SELECT * FROM PRODUCTS

You can then test a comparison using
SELECT * FROM PRODUCTS WHERE PRICE BETWEEN 13 and 16;

You can test MAX by
SELECT Productname, Price FROM Products where Price = (select max(price) from Products);


This should give you some help re your issue.
 
So what have you tried ? We can't see enough from your jpg of the data, what your query is trying that doesn't work. etc.
I can however see a very "interesting" table layout. Tables called Step1, Step2 etc tend to indicate a very poor structure, that will no doubt start making your queries very difficult.
 
i have a form
i have three text boxes in it as date
i can enter date in these text boxes
i want to make a query and one of my columns in this query is creration date
i want that this creation date would be less than max value(date) of these text boxes.
cany ou guide me please?
 
hello

i attched it again
 

Attachments

  • Unbenannt.jpg
    Unbenannt.jpg
    97.1 KB · Views: 117
Why would you need three dates on your form if you only want the maximum one - I'm a bit puzzled by the logic of this?

What have you tried so far? Please cut and paste the criteria you have tried. The JPG is not the way forward for this.
 
because these data is saved in another table
and by runnung this append query the data from my table is inseted to another table that i want

i wrote this in criteria of creation date field in my query but it doesn't work

<Max([Forms]![frmlocalprojects]![Text5] And[Forms]![frmlocalprojects]![Text28] )
 
As Minty said, the jpg isn't communicating the issue. You sent the same jpg 3 times???
In plain English - what are you trying to do?
Please show us you table design -- it appears to be a structural problem (not normalized) and that will add complexity to any query.
 
hello

i attached it again
maybe this time is better
i explained it as :

i have a form
i have three text boxes in it as date
i can enter date in these text boxes
i want to make a query and one of my columns in this query is creration date
i want that this creation date would be less than max value(date) of these text boxes.
 

Attachments

  • Unbenannt.jpg
    Unbenannt.jpg
    95.3 KB · Views: 124
<Max([Forms]![frmlocalprojects]![Text5] And[Forms]![frmlocalprojects]![Text28] )
This won't work - you can't have a Max Value AND another value
You need to break this down into two stages;

First find the Max() value of the three fields. Use an IIF to do this first.
Something like this but I'm sure I haven't quite got the logic correct IIF(Date1<Date2 ,(IIF (Date2>Date3,Date2,Date3)),Date1)
Then use that as your criteria.

I still doubt the need for three fields if your data was properly organised...
 

Users who are viewing this thread

Back
Top Bottom