Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get max date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01652423
Message ID:
01652426
Vues:
89
This message has been marked as the solution to the initial question of the thread.
>>>Sir I am trying to get maximum date from smalldatetime column
>>>For this I am using this command
>>>
>>>
>>>select  max(convert(varchar(10),vou_date,103))as max_date from payments
>>>
>>>
>>>but it is not showing correct date.
>>>
>>>Please see attachment
>>>
>>>Thanks
>>
>>The result it's true. Because 23/06/2017 is max string.
>>
>>
>>select  max(vou_date) as max_date from payments
>>
>>
>>
>>MartinaJ
>
>Thanks but the max date is 2017-05-07 as shown in attachment
>
>How to get it?
select  max(vou_date) as max_date from payments // return max datetime
select  max(CAST(vou_date AS DATE)) as max_date from payments // return max datetime without time - MS SQL 2008>
select  max(CAST(CAST(vou_date AS INT) AS DATETIME)) as max_date from payments // return max datetime without time  <= MS SQL 2005
MartinaJ
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform