Query in access

Results 1 to 2 of 2

Thread: Query in access

  1. #1
    Join Date
    Dec 1969

    Default Query in access

    Guys I have four tables in an access database <BR>1 tblRoomType <BR>roomTypeID (PIK) <BR>roomTypeDesc (text) <BR><BR>2 tblRoomSize <BR>roomSizeID (PIK) <BR>roomSizeDesc (text) <BR><BR>3 tblHolidayPeriod <BR>holidayPeriodID (PIK) <BR>startDate (date/time) <BR>endDate (date/time) <BR>holidayPeriodDesc (text) <BR><BR>4 tblRates <BR>rateID (PIK) <BR>roomTypeID (number) <BR>roomSizeID (number) <BR>holidayPeriodID (number) <BR>rate (currency) <BR><BR>I have a form in which user can select room size, start and and end date and I have to give the user prices for three different types of room for that room size for that period. I cann&#039;t get this into my head. Can anyone help? <BR>TIA <BR><BR><BR>Sharjeel <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Query in access

    SELECT TOP 3 rt.roomTypeDesc, r.rate<BR>FROM tblRoomType rt<BR>INNER JOIN tblRates r ON rt.roomTypeID = r.roomTypeID<BR>INNER JOIN tblRoomSize rs ON r.roomSizeID = rs.roomSizeID<BR>INNER JOIN tblHolidayPeriode hp ON r.holidayPeriodID = hp.holidayPeriodeID<BR>WHERE ([Some date] BETWEEN startDate and endDate) AND rt.roomTypeID = [Some roomtypeid]<BR><BR>this assumus the user passes a date and a roomtype to the query. If this is not what you need, please provide an example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts