Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get blank rows?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00749514
Message ID:
00749522
Vues:
22
This message has been marked as a message which has helped to the initial question of the thread.
You may use UNION here:
SELECT hst.order_date, bsn.store_name, hst.total, hst.earned ;
	FROM history AS hst, business AS bsn;
	WHERE bsn.vchr_code==hst.vchr_code .AND. ;
		BETWEEN(hst.order_date,{^2001-09-01},{^2002-08-31}) ;
UNION;
SELECT {}, bsn.store_name, 00000.00, 000000.00 ;
	FROM business bsn;
	WHERE bsn.vchr_code not in ;
            (sele vchr_code from  history);
ORDER BY 2,1 ;
INTO TABLE ecrtemp
Field types and lengths must be the same in both union statements (correct 00000.00 above as needed), and the order must be by field number in select.

>Here's an SQL SELECT that I'v cobbled together that gave me the results I was looking for:
>
SELECT hst.order_date, bsn.store_name, hst.total, hst.earned ;
>	FROM history AS hst, business AS bsn;
>	WHERE bsn.vchr_code==hst.vchr_code .AND. ;
>		BETWEEN(hst.order_date,{^2001-09-01},{^2002-08-31}) ;
>	ORDER BY bsn.store_name, hst.order_date ;
>	INTO TABLE ecrtemp.DBF
>Now, how do I get it to add a 'blank' row (a name but no date-total-earned) for records in the business table that do not have any matching data in history?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform