Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Could I define Min/Max Dates in one select?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00574696
Message ID:
00574699
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
Something like
MIN(IIF(DeedType = "LC", date, DATE(9999,12,31)) AS  MinLCActDate,
>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.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform