Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Adding to a date

Questions related to using nuBuilder Forte.
Post Reply
ALW
Posts: 2
Joined: Tue Jun 11, 2019 4:21 pm

Adding to a date

Unread post by ALW »

Hi there,

I've just started using nuBuilder (which I'm loving so far!) and as a test case I'm building a simple database that keeps records of equipment and when it was last calibrated. Most fields are either typed by the user or lookups from other tables and that's all working a treat.

I want a column in the form that displays the calibration due date, which would be the calibration date field + 2 years. I initially set this up as a calc field in the initial form (so I have a database field allocated to it), but realised it isn't possible to do calculations on date fields, so I've hit a brick wall currently on how to achieve this.

Can anyone point me in the right direction please?

Thanks,

Andy.
Alohajoe5
Posts: 55
Joined: Tue Apr 16, 2019 1:32 pm

Re: Adding to a date

Unread post by Alohajoe5 »

Andy,

Have you considered adding a field like Calculated_Date and using a DATE_ADD() function? The arguments DATE_ADD() accepts are listed here:

https://www.w3schools.com/sql/func_mysql_date_add.asp

Then, you could simply display that field.
ALW
Posts: 2
Joined: Tue Jun 11, 2019 4:21 pm

Re: Adding to a date

Unread post by ALW »

Have you considered adding a field like Calculated_Date and using a DATE_ADD() function?
Thank you!

I don't know why I didn't think of this, as I'd already used CONCAT in another field to combine multiple values, but my SQL is rusty and this was just the trigger I needed!
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Adding to a date

Unread post by admin »

.
Post Reply