Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date Extraction

 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i have a table in which i have a field with date & time but its data type is date

now i want to comapre my this field on basis of month & year entered by me

Now i want to know how can i extract month & year only from my this field in database

Please help me

thank you
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this help?



http://developer.postgresql.org/pgdocs/postgres/functions-datetime.html
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of course won't work in several other servers like MS SQL Server. That one has functions YEAR, MONTH, DAY and DATEPART. So without knowing the database server in question we cannot answer this question (unless we provide the answer for each and every database server available).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic