funcation date (-) [message #379109] |
Sun, 04 January 2009 23:41 |
CLS63AMGV8
Messages: 11 Registered: November 2008 Location: Oman
|
Junior Member |
|
|
hi guys how are you
i want to (-) but gave me mistake
create view vw_search_rooms as
SELECT BookIngs1.g_Id,
BookIngs1.Date_From,
BookIngs1.Date_To,
Room_Types1.Room_desc,
Room_Types1.Room_Rate,
Rooms1.Room_No,
Rooms1.r_Floor,
Rooms1.r_Suite,
Rooms1.Reserved,
Rooms1.Room_tc,
Rooms1.b_Id,
(sysdate Bookings1.Date_To - Bookings1.Date_From) AS Nights, (Room_Types1.Room_Rate * Nights) AS Total_Amounts
FROM Room_Types1
INNER JOIN (BookIngs1
INNER JOIN Rooms1
ON BookIngs1.b_Id = Rooms1.b_Id)
ON Room_Types1.Room_tc = Rooms1.Room_tc;
|
|
|
|
|
Re: funcation date (-) [message #379185 is a reply to message #379127] |
Mon, 05 January 2009 05:17 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Additionally, you cannot use an alias for a column in the same level that you define that alias in.
Ie In your select list you have:
,(Bookings1.Date_To - ,Bookings1.Date_From) AS Nights
,(Room_Types1.Room_Rate * Nights) AS Total_Amounts
You cannot refer to Nights in the Total_Amounts column - you'd have to repeast the calculation used to create it.
|
|
|