Ver Mensaje Individual
  #4  
Antiguo 08-08-2007
Avatar de gluglu
[gluglu] gluglu is offline
Miembro Premium
 
Registrado: sep 2004
Ubicación: Málaga - España
Posts: 1.455
Reputación: 21
gluglu Va por buen camino
Gracias a los dos por responder.

De momento me lo acepta así
Código SQL [-]
begin
  for Select BOJ.BOOKINGNO
  from BOOKINGS_OBJECTS BOJ
  left join BOOKINGS BO
    on BO.BOOKINGNO = BOJ.BOOKINGNO
  where
    BOJ.BUILDINGNO = :"BUILDING_NO" and
    BOJ.OBJECTNO = :"OBJECT_NO" and 
    BOJ.DATETO <= :"DATE_SP" and
    BO.STATUS = 3
    Into BOOK_NO
  do
    begin
      if (not :"BOOK_NO" is Null) then
        SUSPEND;
      else begin
        Select BOJ2.BOOKINGNO 
        from BOOKINGS_OBJECTS BOJ2
        left join BOOKINGS BO2
          on BO2.BOOKINGNO = BOJ2.BOOKINGNO
        where
          BOJ2.BUILDINGNO = :"BUILDING_NO" and
          BOJ2.OBJECTNO = :"OBJECT_NO" and
          BOJ2.DATEFROM >= :"DATE_SP" and
          BOJ2.DATETO <= :"DATE_SP" and
          BO2.STATUS <= 2
          Into BOOK_NO;
      end
    end
end

Ahora tengo que probar si me hace correctamente lo que quiero obtener
__________________
Piensa siempre en positivo !
Responder Con Cita