hello to all!
I hope you're getting on ok in the current crazy situation.
my question:
i have a select statement that collects data from several tables into a cursor.
SELECT bdate, platforma.descr, house.h_name, guest.descr, CDOW(checkin)+" "+DMY(checkin), nights,;
CDOW(checkin+nights)+" "+DMY(checkin+nights), price, deposit, ALLTRIM(booking.notes), booking.aa, house, checkin, bplatform, client.aa;
FROM booking;
JOIN house ON booking.house = house.aa;
JOIN platforma ON booking.bplatform = platforma.aa;
JOIN guest ON booking.guest = guest.aa;
JOIN client ΟΝ house.client = client.aa;
WHERE house=IIF(EMPTY(ALLTRIM(staform.bshouse.value)),house,val(staform.bshouse.value)) and;
bplatform=IIF(EMPTY(ALLTRIM(staform.bsplatform.value)),bplatform,VAL(staform.bsplatform.value))and;
checkin >= staform.wsdate.value AND checkin <= staform.wedate.value and;
bookopt(booked, canceled, staform.bookoption.value) and;
house.client=IIF(EMPTY(ALLTRIM(staform.bsclient.value)),house.client,val(staform.bsclient.value));
ORDER BY &wsort;
INTO CURSOR eResults
this date represents bookings on several properties that belong to different clients.
these bookings are from different platforms.
i want to get statistics from this data like total rental days per house and then per platform,
total earnings per house and per platform etc.
what is the best way to do that?
do i scan the date several times and collect results in arrays?
do i use calculate or sum commands?
is there a way to do that while collecting the data into the cursor?
thank you
Andreas
I hope you're getting on ok in the current crazy situation.
my question:
i have a select statement that collects data from several tables into a cursor.
SELECT bdate, platforma.descr, house.h_name, guest.descr, CDOW(checkin)+" "+DMY(checkin), nights,;
CDOW(checkin+nights)+" "+DMY(checkin+nights), price, deposit, ALLTRIM(booking.notes), booking.aa, house, checkin, bplatform, client.aa;
FROM booking;
JOIN house ON booking.house = house.aa;
JOIN platforma ON booking.bplatform = platforma.aa;
JOIN guest ON booking.guest = guest.aa;
JOIN client ΟΝ house.client = client.aa;
WHERE house=IIF(EMPTY(ALLTRIM(staform.bshouse.value)),house,val(staform.bshouse.value)) and;
bplatform=IIF(EMPTY(ALLTRIM(staform.bsplatform.value)),bplatform,VAL(staform.bsplatform.value))and;
checkin >= staform.wsdate.value AND checkin <= staform.wedate.value and;
bookopt(booked, canceled, staform.bookoption.value) and;
house.client=IIF(EMPTY(ALLTRIM(staform.bsclient.value)),house.client,val(staform.bsclient.value));
ORDER BY &wsort;
INTO CURSOR eResults
this date represents bookings on several properties that belong to different clients.
these bookings are from different platforms.
i want to get statistics from this data like total rental days per house and then per platform,
total earnings per house and per platform etc.
what is the best way to do that?
do i scan the date several times and collect results in arrays?
do i use calculate or sum commands?
is there a way to do that while collecting the data into the cursor?
thank you
Andreas