GeekInterview.com
Series: Subject:
Question: 7 of 196

How to get 1st date of a month ?

During preparation of report in *.RDF , there are two things on date & to date on date is the i/p value , but to date = 1st day of this month on date how ?
Asked by: dinaballavsahoo | Member Since Apr-2012 | Asked on: Apr 19th, 2012

View all questions by dinaballavsahoo

Showing Answers 1 - 4 of 4 Answers
Rakesh

Answered On : May 29th, 2012

In rdfs sql section,you just formate the to_date as fallow:

sql
where to_char(datefield,dd/mm/yyyy)=to_char(to_date,01||/mm/yyyy)

  
Login to rate this answer.
Chip Dawes

Answered On : Jun 4th, 2012

To get the first date of a month, truncate the date to the month, like this:

Code
  1. SELECT trunc(my_date,Mon) FROM dual;

  
Login to rate this answer.

select last_day(add_months(trunc(sysdate),-1)) + 1 from dual;

OR

select trunc(sysdate,MON) from dual;

  
Login to rate this answer.
Krishna

Answered On : Apr 3rd, 2013

Select Trunc(SYSDATE,MON) From Dual;

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.