Link to home
Start Free TrialLog in
Avatar of Johnny2pints
Johnny2pints

asked on

Sybase Date Functions

Does Sybase have year() and month() functions for DATETIME type?
ASKER CERTIFIED SOLUTION
Avatar of DaniPro
DaniPro
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of alpmoon
alpmoon
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mallesh
Mallesh

This example clearly explain, how to get year.  Replace ur variable at getdate function (returns system date)

1> select getdate()
2> go                          
 --------------------------
        Mar 29 2003 11:49AM
(1 row affected)

1> select datepart(year, getdate())
2> go            
 -----------
        2003
(1 row affected)