Forums: add date + 1 year - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

add date + 1 year Rate Topic: -----

#1 User is offline   apowazniak 

  • Member
  • PipPip
  • Group: Members
  • Posts: 10
  • Joined: 22-July 14

Posted 29 May 2017 - 12:57 PM

I have 2 fields in the same table, start_date and end_date, I need date_final to be loaded alone based on start_date + 1 year
0

#2 User is offline   Arkie 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 60
  • Joined: 19-October 15

Posted 12 June 2017 - 07:19 PM

In AspRunner.Net (haven't yet used Pro), the only way I could make this work in an Access database was to add x number of years to the current date as in :
DateTime.Now.AddYears(x)

This function doesn't appear to work for any other starting date other than .Now, or maybe I just couldn't come up with the correct syntax.

I think the syntax is totally different when using SQL and even then it depends on the what flavor of SQL, i.e. MySQL, Microsoft, or something else.

~Joe
0

#3 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15433
  • Joined: 03-February 03

Posted 13 June 2017 - 09:18 PM

There multiple ways to do this, using both SQL Queries and events and it all depends on when this calculation needs to take place. Here are code examples:
https://xlinesoft.co...b-applications/
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked