Click here to Skip to main content
16,009,720 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
select A.Visibility,A.MsgDatetime,I.Stationname,I.ICAOCode from AVI_02Mar2016 A join AVI_ICAOCodeList I on A.ICAOCode =I.ICAOCode where I.country ='India' and
MsgDatetime between convert(datetime,'02 Mar 2016 11:00:00') and convert(datetime,'02 Mar 2016 12:00:00')

What I have tried:

SELECT MAX(Visibility) FROM AVI_02Mar2016
WHERE Visibility IN (select A.Visibility,A.MsgDatetime,I.Stationname,I.ICAOCode from AVI_02Mar2016 A join AVI_ICAOCodeList I on A.ICAOCode =I.ICAOCode where I.country ='India' and
MsgDatetime between convert(datetime,'02 Mar 2016 11:00:00') and convert(datetime,'02 Mar 2016 12:00:00'))
Posted
Updated 9-Mar-16 23:26pm
v3
Comments
OriginalGriff 10-Mar-16 3:07am    
And?
What happened that you didn't expect, or didn't happen that you did?
Member 12119075 10-Mar-16 3:41am    
am not getting what i expect , i need to get (max) visibility
OriginalGriff 10-Mar-16 3:52am    
That tells us nothing - we can infer that from your question - but we have no access to your data, so we do not know what you do get, and from what input. Since both of those are likely to be relevant to the question, we need better information in order to help you!
So...try posting "sample data" which shows the problem, and show us what you get from it, and what you expect to get. We can't work in the dark! :laugh:
Use the "Improve question" widget to edit your question and provide better information.

1 solution

SELECT MAX(Visibility) FROM (select distinct A.Visibility,A.MsgDatetime,I.Stationname,I.ICAOCode from AVI_02Mar2016 A join AVI_ICAOCodeList I on A.ICAOCode =I.ICAOCode where I.country ='India' and
MsgDatetime between convert(datetime,'02 Mar 2016 11:00:00') and convert(datetime,'02 Mar 2016 12:00:00' ))as a
 
Share this answer
 
Comments
Member 12119075 10-Mar-16 4:29am    
i need to take stationname along with max visibility , what shall i do ?
actually i neeed a station name for highest visiblity
Member 12119075 10-Mar-16 4:37am    
And can u teach why we need (as a)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900