The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

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?

 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

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

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

 
#3
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

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

 
#4
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

You can use EndOfYear() function for that.

 
#5
People who like this: 0 Yes / 0 No
Active user
Rating: 2
Joined: Oct 7, 2014
Company:

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

Edited: Laysan Martin - Nov 12, 2015 12:09 AM
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)