File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Date Extraction Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Date Extraction" Watch "Date Extraction" New topic
Author

Date Extraction

Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
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
Ranch Hand

Joined: Jan 08, 2009
Posts: 1196

Does this help?



http://developer.postgresql.org/pgdocs/postgres/functions-datetime.html


Swastik
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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).


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Date Extraction
 
Similar Threads
Date/Time Problem
Dealing with results of java time code
Comparing 2 dates
h:outputText: Default Value
Tags for displaying Date Input field in STRUTS?