1

I am trying to decode this little peice of java code (using an oracle10g database) from a left over program i am remaking in VB.net. Say i chose on the datepicker 01/02/11:

AND (due_date between (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() 
+ "', 'MM/DD/YY') - 1) 
AND (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') + 1) 
OR " + "begin_date between (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') - 1) 
AND (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') + 1))

Where the +1's are, is it adding a month (02/02/11) or day (01/03/11)? And for the -1's, is it subtracting a month (12/02/10) or a day (01/01/11)?

David

1
  • Whatever does pay the bills is good enough, huh Commented Jan 27, 2011 at 14:14

1 Answer 1

2

It's subtracting/adding a day.

Try running:

select toDate('10/01/09', 'MM/DD/YY') - 1 from whatever_table

it should return:

09/30/09
Sign up to request clarification or add additional context in comments.

3 Comments

If the database has '11/2/2009 3:00:20 PM' format how would i covert that to what i am trying to toDate? I've already tried where to_date(BEGIN_DATE, 'MM/DD/YY') but that gives an error.
Convert the comment to a question and you'll earn even more points :)
I just got a "Cleanup" badge for that :o)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.