Author Topic: Adding Days to a Date Field  (Read 659 times)

Offline gatorfe

  • Senior Member
  • ****
  • Posts: 73
  • Forum Citizenship: +0/-0
Adding Days to a Date Field
« on: 03 Aug 2007 03:12:47 am »
I have a report that shows me my orders and their schedule.  I just want to show the orders that have a scheduled date for the next 7 days so I know what needs to go out soon.  What should the formula syntax be for something like that?  Any suggestions would be greatly appreciated.

Offline pvrraju

  • Associate
  • **
  • Posts: 1
  • Forum Citizenship: +0/-0
Re: Adding Days to a Date Field
« Reply #1 on: 07 Aug 2007 02:12:16 pm »
Hi

Create a HTML tag and copy the following code.

Please change your date prompt name ("txtDatefromDate" which is bold and red in colour)  in the code and check. I think it will work

<script type="text/javascript">

var date = new Date();
var newDate = new Date();
newDate.setDate(date.getDate()+7);
var day = newDate.getDate();
var month = newDate.getMonth();
var year= newDate.getYear();
var months = new Array('Jan','Feb','Mar','Apr','May',
'Jun','Jul','Aug','Sep','Oct','Nov','Dec');
document.forms[0].elements["txtDatefromDate"].value= months[month]+" "+day+", "+year;

</script>

Offline bdybldr

  • Global Moderator
  • Statesman
  • *****
  • Posts: 275
  • Forum Citizenship: +7/-1
Re: Adding Days to a Date Field
« Reply #2 on: 20 Sep 2007 01:39:05 am »
Try this....

to_date({sysdate}) + 7
OR
 _add_days({sysdate}, 7)