dubt on a SQL query with between dates

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

dubt on a SQL query with between dates

Post by sal21 »

sQL="SELECT PRENOTAZIONI.IDTIP, [ANAGRAFICA.IDCLI] & '-' & [COGNOME] & ' ' & [NOME] & '-(' & [DTNASC] & ')' AS CLIENTE, PRENOTAZIONI.DAL, PRENOTAZIONI.AL FROM PRENOTAZIONI INNER JOIN ANAGRAFICA ON PRENOTAZIONI.IDCLI=ANAGRAFICA.IDCLI WHERE (PRENOTAZIONI.DAL>=#08/01/2024# AND PRENOTAZIONI.AL<=#08/15/2024#) AND PRENOTAZIONI.STRUTTURA='MARE' AND PRENOTAZIONI.CANCL IS NULL AND PRENOTAZIONI.IDTIP='11' AND PRENOTAZIONI.CANCL IS NULL"

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

Re: dubt on a SQL query with between dates

Post by HansV »

What is the problem?
Best wishes,
Hans

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

Re: dubt on a SQL query with between dates

Post by HansV »

Moved from the VBA forum to the Access/SQL forum.
Best wishes,
Hans

George Hepworth
NewLounger
Posts: 12
Joined: 13 Jun 2024, 12:24

Re: dubt on a SQL query with between dates

Post by George Hepworth »

I see that the highlighted critieria is repeated twice. Why?

SELECT PRENOTAZIONI.IDTIP, [ANAGRAFICA.IDCLI] & '-' & [COGNOME] & ' ' & [NOME] & '-(' & [DTNASC] & ')' AS CLIENTE, PRENOTAZIONI.DAL, PRENOTAZIONI.AL FROM PRENOTAZIONI INNER JOIN ANAGRAFICA ON PRENOTAZIONI.IDCLI=ANAGRAFICA.IDCLI WHERE (PRENOTAZIONI.DAL>=#08/01/2024# AND PRENOTAZIONI.AL<=#08/15/2024#) AND PRENOTAZIONI.STRUTTURA='MARE' AND PRENOTAZIONI.CANCL IS NULL AND PRENOTAZIONI.IDTIP='11' AND PRENOTAZIONI.CANCL IS NULL"

Perhaps, if you can explain in words what the goal is, someone can offer useful suggestions.