Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > how to get date of 1 week later, actually x week later

Forum

Search UsersRules
how to get date of 1 week later, actually x week later
#1
Active user
Points:: 0
Joined:: Jul 28, 2015

Hi everyone,

I have to get date of x week later from selected date on that year.

I mean f.e I select today as begining day and I want to get all date of 3 weeks on period in this year (f.e 2015). How can I do that* Could you help me pelase?

Profile
#2
Guest
Points::
Joined::

Hello, Mehmet Tuğrul SARIÇİÇEK.

You can add 7*24*60*60 to the date to get 1 week added to that date.

Profile
#3
Active user
Points:: 0
Joined:: Jul 28, 2015

Thank you Timofey Bugaevsky, I got it, and How can I get last day of this year?

Profile
#4
Guest
Points::
Joined::

You can use EndOfYear() function for that.

Profile
#5
Active user
Points:: 0
Joined:: Oct 7, 2014

I have a procedure "GetNewDay" so I can get any day I want back or ahead.

Code
Function GetNewDay(InitialDate, NumberDays)  Export
   
   Query = New Query;
   
   Query.SetParameter("InitialDate", InitialDate); 
   Query.SetParameter("NumberDays", NumberDays); 

   Query.Text = 
   
   "Select 
   |   DateAdd(&InitialDate, Day, &NumberDays) AS Day";

   
   Return Query.Execute().Unload()[0].Day; 

EndFunction

DueDate        = GetNewDay(InvoiceDate, +15); or
ThreeDaysBefore = GetNewDay(InvoiceDate, -3);

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.