Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Could I define Min/Max Dates in one select?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Could I define Min/Max Dates in one select?
Divers
Thread ID:
00574696
Message ID:
00574696
Vues:
51
Hi everyone,

Currently I have the following select statement:
select  Towns.State, Towns.CCODE, Towns.RCode, ;
		iif(m.lcState="MA",space(4),Towns.TOWN) as TOWN, ;
		sum(iif(!empty(Seller),1,0)) as LogNumSal,  ;
		sum(iif(empty(Seller),1,0)) as LogNumMtg,  ;
		sum(iif(PRICE>=1000000 or MORTGAGE>=1000000,1,0)) as LogNumMM,  ;
		min(date) as MinActDate, max(date) as MaxActDate, ;
		M.lcJustName as FileName, ;
		iif(EXTRYEAR<"10","20"+EXTRYEAR,"19"+EXTRYEAR) as EXTRYEAR, EXTRWEEK ;
		from (m.lcFileName) tbl ;
		INNER join Towns on tbl.CCODE + tbl.TOWN = Towns.CCODE + Towns.townold ;
		group by 1, 2, 3, 4 ; && Group by registry for MA
	into cursor curTemp
We just changed our mind and decide, that we would like to calculate separately MinActDate and MinLCActDate, where first is when DeedType<>"LC" and the second is when DeedType = "LC". I'm thinking, how can I modify this select, to produce both fields correctly?

Could you please advise?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform