TVRV8S Posted November 26, 2012 Posted November 26, 2012 Is it possible to use SELECT TOP in an ExecuteSQL statement? I can find no mention or questions about this on the web. I want to find the most recent date in a range of dates and pass this to a script. SELECT TOP would enable this very easily.
Wim Decorte Posted November 28, 2012 Posted November 28, 2012 I don't think it is supported natively. The obvious way around it is to do an ORDER BY and use the FM function getvalue to retrieve the first or last value in your list (depending on your sort)
dansmith65 Posted November 28, 2012 Posted November 28, 2012 I'm not familiar with what SELECT TOP is supposed to do, but it sounds like SELECT MAX() could work, and I believe it's supported.
john renfrew Posted November 28, 2012 Posted November 28, 2012 Select TOP is not supported Select MAX() is not the same thing, it selects the maximum from some values, not the first one.
TVRV8S Posted November 29, 2012 Author Posted November 29, 2012 Thanks chaps. It does seem a bit odd that it's not supported. It's a very useful thing. I will look into the getvalue function and muddle through with that.
Recommended Posts
This topic is 4388 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now