Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Could I define Min/Max Dates in one select?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00574696
Message ID:
00574739
Views:
34
>Nadya,
>
>Perhaps I do not get it, but why do not include isnull like:
>
>?Min(date,iif(isnull(date), {^3000-01-01},date))

What the whole statement for the date would be? How we get nulls at all?

>
>>>Did you try Null?
>>
>>How should I try it? BTW, he wants blank, not nulls. Min(date(),NULL) returns NULL.
>>
>>>>Ok, I discussed this problem, and he wants blank dates, if where are no LC records in a file. So, unfortunately, this problem could not be solved in one select. It now becomes much more complicated... :(
>>>>
>>>>>The only problem I can see with this code, that you'll get DATE(9999,12,31) as a MinLCActDate if there're no records with DeedType = "LC". You can try to use Null instead of DATE(9999,12,31) to fix it (not tested).
>>>>>
>>>>>>Exactly :) I figured this out by myself (decided to finally eat lunch). Anyway, three stars for you (I knew, you would be the first to answer :))
>>>>>>
>>>>>>>Something like
MIN(IIF(DeedType = "LC", date, DATE(9999,12,31)) AS  MinLCActDate,
>>>>>< snip >
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform