G
Ghena
Hi...
I'm developing a simple query to check availability in an hotel booking
engine
But i have just some problem with IIF
SELECT hotel.Id_htl, hotel.localita, dispo.dal, dispo.al,
dispo.allottment, dispo.realease, prenotazioni.dal, prenotazioni.al,
IIf(IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
),0,IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
) AS tot
FROM prenotazioni, dispo INNER JOIN hotel ON dispo.id_htl =
hotel.Id_htl
GROUP BY hotel.Id_htl, hotel.localita, dispo.dal, dispo.al,
dispo.allottment, dispo.realease, prenotazioni.dal, prenotazioni.al
HAVING (((hotel.localita)="Roma") AND ((dispo.dal)<=#6/21/2005#) AND
((dispo.al)>=#6/24/2005#) AND ((prenotazioni.dal)<=#6/21/2005#) AND
((prenotazioni.al)>=#6/24/2005#));
The error is : Wrong Argument in the query:
IIf(IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
),0,IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
)
could you help me.
Thanks a lot.
I'm developing a simple query to check availability in an hotel booking
engine
But i have just some problem with IIF
SELECT hotel.Id_htl, hotel.localita, dispo.dal, dispo.al,
dispo.allottment, dispo.realease, prenotazioni.dal, prenotazioni.al,
IIf(IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
),0,IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
) AS tot
FROM prenotazioni, dispo INNER JOIN hotel ON dispo.id_htl =
hotel.Id_htl
GROUP BY hotel.Id_htl, hotel.localita, dispo.dal, dispo.al,
dispo.allottment, dispo.realease, prenotazioni.dal, prenotazioni.al
HAVING (((hotel.localita)="Roma") AND ((dispo.dal)<=#6/21/2005#) AND
((dispo.al)>=#6/24/2005#) AND ((prenotazioni.dal)<=#6/21/2005#) AND
((prenotazioni.al)>=#6/24/2005#));
The error is : Wrong Argument in the query:
IIf(IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
),0,IsNull(select sum(sell_q) from prenotazioni Where
id_htl=[hotel]![id_htl] and dal <= #21/06/2005# and al >=#24/06/2005#
)
could you help me.
Thanks a lot.