S
S
Stardust2019-12-06 02:07:39
Microsoft Access
Stardust, 2019-12-06 02:07:39

How to create a query in SQL?

There is such a query in MS Access (text below), how to write it in SQL? Tell me please.
5de98cbc81df4436101895.png

SELECT Клиенты.Фамилия, Посещения.Номер_домика, Посещения.Дата_заезда, Посещения.[Количество дней], IIf(Посещения.Номер_домика Mod 2=0,IIf(Weekday(Посещения.Дата_заезда,2) Between 6 And 7,1300+1100*([Количество дней]-1),1100*[Количество дней]),IIf(Weekday(Посещения.Дата_заезда,2) Between 6 And 7,1200+([Количество дней]-1)*1000,[Количество дней]*1000)) AS [Оплата проживания]
FROM Клиенты INNER JOIN Посещения ON Клиенты.Код_клиента = Посещения.Код_клиента
ORDER BY Клиенты.Фамилия, Посещения.Дата_заезда;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question