Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Question
Message
From
07/12/1998 11:54:21
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00164809
Message ID:
00164816
Views:
17
>I just found this thread site, it looks great. I'm new to database programming and Foxpro, so please forgive my beginner questions...
>
>I need to do a SELECT statement that returns the greater (most recent?) of two dates, which are in two separate fields (like date1 and date2). I'm not sure how to do that in SQL so that the results contain just one of the two dates, like:
>
>Account
>.
>.
>.
>Result Date
>
>By the way, I get the feeling that I would benefit greatly from a good SQL book. Anyone have any suggestions? It would be great of course if it were related to Foxpro.
>
>Thanks!

I believe this should fit the bill:

SELECT IIF(Date1 > Date2, Date1, Date2) AS ResultDate...

HTH
Paul M.
MCSE/MCSA/MCT/MCP+I, A+, Network+, I-Net+
Nil carborundum illegitimi.
Previous
Reply
Map
View

Click here to load this message in the networking platform