Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Could I define Min/Max Dates in one select?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Could I define Min/Max Dates in one select?
Miscellaneous
Thread ID:
00574696
Message ID:
00574696
Views:
53
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
Next
Reply
Map
View

Click here to load this message in the networking platform