i have a number of ombrella free?
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
i have a number of ombrella free?
i need to check if in FILA=1, have a free number of ombrella beach by GIORNO=01/08/2021, in my case have a number 20 ombrella...
FILA is the number of row.
NUMERO is the number of ombrella per row (FILA)
for each FILA I CAN HAVE A FIXED NUMBER OF OMMBRELLA=50
I i need a SQL, to select all number of ombrella free, by FILA...
in my case FILA 1 have only a free NUMERO=20
FILA is the number of row.
NUMERO is the number of ombrella per row (FILA)
for each FILA I CAN HAVE A FIXED NUMBER OF OMMBRELLA=50
I i need a SQL, to select all number of ombrella free, by FILA...
in my case FILA 1 have only a free NUMERO=20
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
See the attached database. I created two auxiliary tables and a query.
The query returning the free umbrellas is LIBERO.
The query returning the free umbrellas is LIBERO.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
Re: i have a number of ombrella free?
OPS...
i have just modified my post when you write a solution ...
i need to add also a GIORNO in the where clausole, sorry..
for example ... WHERE OMBRELLONI.GIORNO=15/08/2021 ...
TKS.
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
See below.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
Yes, replace
WHERE OMBRELLONI.GIORNO=#8/01/2021#
with for example
WHERE OMBRELLONI.GIORNO BETWEEN #8/01/2021# AND #8/12/2021#
Remember that you must specify dates in US format m/d/yyyy in SQL.
WHERE OMBRELLONI.GIORNO=#8/01/2021#
with for example
WHERE OMBRELLONI.GIORNO BETWEEN #8/01/2021# AND #8/12/2021#
Remember that you must specify dates in US format m/d/yyyy in SQL.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
Re: i have a number of ombrella free?
TESTED and it work!
sorry...
if i can extract only a distinct value of FILA, based a free NUMBER?
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
What do you mean? I'm afraid I don't understand.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
Re: i have a number of ombrella free?
SELECT DISTINCT COMBI.NUMERO
FROM COMBI LEFT JOIN (SELECT * FROM OMBRELLONI WHERE OMBRELLONI.FILA=2 AND OMBRELLONI.GIORNO=#08/01/2021#) AS Q ON (COMBI.FILA = Q.FILA) AND (COMBI.NUMERO = Q.NUMERO)
WHERE Q.FILA IS NULL
ORDER BY COMBI.NUMERO
why have a complete list 50!
see image with filter on FILA and GIORNO
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
What is the problem? I see only 5 records in the screenshot.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
Sorry, I don't understand. Could you attach the database with the query?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
Re: i have a number of ombrella free?
SELECT DISTINCT COMBI.NUMERO
FROM COMBI LEFT JOIN (SELECT * FROM OMBRELLONI WHERE OMBRELLONI.FILA= 2 AND OMBRELLONI.GIORNO=#8/01/2021#) AS Q ON (COMBI.FILA = Q.FILA) AND (COMBI.NUMERO = Q.NUMERO)
WHERE Q.FILA Is Null
ORDER BY COMBI.NUMERO
I need to return in a distinct set of a free NUMERO of OMBRELLONI based FILA=2 and GIORNO=01/08/2021.
in this case are not free only 5 NUMBER (you see in screenshot)
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
SELECT DISTINCT COMBI.NUMERO
FROM COMBI LEFT JOIN (SELECT * FROM OMBRELLONI WHERE OMBRELLONI.FILA= 2 AND OMBRELLONI.GIORNO=#8/01/2021#) AS Q ON (COMBI.NUMERO = Q.NUMERO) AND (COMBI.FILA = Q.FILA)
WHERE (((COMBI.FILA)=2) AND ((Q.FILA) Is Null))
ORDER BY COMBI.NUMERO;
FROM COMBI LEFT JOIN (SELECT * FROM OMBRELLONI WHERE OMBRELLONI.FILA= 2 AND OMBRELLONI.GIORNO=#8/01/2021#) AS Q ON (COMBI.NUMERO = Q.NUMERO) AND (COMBI.FILA = Q.FILA)
WHERE (((COMBI.FILA)=2) AND ((Q.FILA) Is Null))
ORDER BY COMBI.NUMERO;
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36
Re: i have a number of ombrella free?
But this query return a list of 50 NUMERO free!(immagine.jpg)
i need a list of 45 NUMERO free!
see the immagine1.jpg are the NUMERO just not free
i need
1
2
3
4
5
6
7
8
9
10
11
13
14
15
16
18
20
....
38
40
41
43
...
50
in my report(immagine2.jpg) the blank cell are the free NUMERO free
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78387
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: i have a number of ombrella free?
Here is the database with the query.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4341
- Joined: 26 Apr 2010, 17:36