WHY THE QUERY DOESN'T WORK ANYMORE

User avatar
sal21
PlatinumLounger
Posts: 4495
Joined: 26 Apr 2010, 17:36

WHY THE QUERY DOESN'T WORK ANYMORE

Post by sal21 »

Attached database.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 79443
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: WHY THE QUERY DOESN'T WORK ANYMORE

Post by HansV »

Because the database does not contain any query.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4495
Joined: 26 Apr 2010, 17:36

Re: WHY THE QUERY DOESN'T WORK ANYMORE

Post by sal21 »

HansV wrote:
30 Sep 2024, 20:43
Because the database does not contain any query.
SELECT PRENOTAZIONI.IDTIP, PRENOTAZIONI.TIPO, PRENOTAZIONI.IDCLI, [COGNOME] & ' ' & [NOME] AS NOMINATIVO, PRENOTAZIONI.DAL, PRENOTAZIONI.AL, PRENOTAZIONI.NRGG, IIf([PRENOTAZIONI].[DAL]>[PREZZI].[DAL],[PRENOTAZIONI].[DAL],[PREZZI].[DAL]) AS PREZZO_DAL, IIf([PRENOTAZIONI].[AL]<[PREZZI].[AL],[PRENOTAZIONI].[AL],[PREZZI].[AL]) AS PREZZO_AL, PREZZI.PREZZO, [PREZZO_AL]-[PREZZO_DAL]+1 AS GG, [PREZZO]*([PREZZO_AL]-[PREZZO_DAL]+1) AS PREZZO_TOTALE, PRENOTAZIONI.AGG, PRENOTAZIONI.CANCL, PRENOTAZIONI.DCANCL
FROM (PRENOTAZIONI INNER JOIN PREZZI ON PRENOTAZIONI.TIPO = PREZZI.TIPO) INNER JOIN ANAGRAFICA ON PRENOTAZIONI.IDCLI = ANAGRAFICA.IDCLI
WHERE (((PRENOTAZIONI.DAL)<=[PREZZI].[AL]) AND ((PRENOTAZIONI.AL)>=[PREZZI].[DAL]) AND ((PREZZI.STRUTTURA)='MARE') AND ((PRENOTAZIONI.AAAA)="2021"))
ORDER BY PRENOTAZIONI.IDTIP, PRENOTAZIONI.IDCLI, IIf([PRENOTAZIONI].[DAL]>[PREZZI].[DAL],[PRENOTAZIONI].[DAL],[PREZZI].[DAL]);

the database have a query baned: PREZZO_CAMERE_HANS
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 79443
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: WHY THE QUERY DOESN'T WORK ANYMORE

Post by HansV »

In PRENOTAZIONI, the fields DAL and AL are date fields.
In PREZZI, the fields DAL and AL are text fields.
This causes the type mismatch. You should change DAL and AL in PREZZI to date/time fields.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4495
Joined: 26 Apr 2010, 17:36

Re: WHY THE QUERY DOESN'T WORK ANYMORE

Post by sal21 »

HansV wrote:
30 Sep 2024, 21:28
In PRENOTAZIONI, the fields DAL and AL are date fields.
In PREZZI, the fields DAL and AL are text fields.
This causes the type mismatch. You should change DAL and AL in PREZZI to date/time fields.
:clapping: