• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date Extraction  RSS feed

 
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: 1784
14
Android Eclipse IDE 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
Posts: 20943
81
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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!