Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
How to subtract dates to calculate nights
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 476 times
- Contact:
Re: How to subtract dates to calculate nights
1000 * 60 * 60 *24 * 365.25 / 12
is the same as
2000 [ which is 24/12*1000 ] * 3600 * 365.25
is the same as
2000 [ which is 24/12*1000 ] * 3600 * 365.25
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 476 times
- Contact:
Re: How to subtract dates to calculate nights
Update nuBuilder (or just replace nuform.php https://github.com/steven-copley/nubuil ... nuform.php) and the error will be gone.joecocs wrote:Can it have a consequence?===USER==========
globeadmin
===PDO MESSAGE===
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE 1' at line 2
===SQL===========
SELECT
WHERE 1
===BACK TRACE====
/volume1/web/ISEA/nuform.php - line 350 (nuRunQuery)
/volume1/web/ISEA/nuform.php - line 331 (nuBrowseTotals)
/volume1/web/ISEA/nuapi.php - line 42 (nuGetFormObject)
-
- Posts: 67
- Joined: Wed Jul 04, 2018 4:11 pm
- Location: France
Re: How to subtract dates to calculate nights
Thank you for the answers,
I continue to optimize my management interface.
A question concerning the date format in the 'browse forms', I cannot change the format.
do you have an idea
I continue to optimize my management interface.
A question concerning the date format in the 'browse forms', I cannot change the format.
do you have an idea
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 476 times
- Contact:
-
- Posts: 67
- Joined: Wed Jul 04, 2018 4:11 pm
- Location: France
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 476 times
- Contact:
Re: How to subtract dates to calculate nights
It's better to ask just one question per topic. Now your question is not related to the original topic "How to subtract dates to calculate nights".
It allows other people with a similar problem to find the answer more easily.
It allows other people with a similar problem to find the answer more easily.
-
- Posts: 15
- Joined: Sat Feb 01, 2020 4:04 pm
Re: How to subtract dates to calculate nights
joecocs wrote:YESSSSSSSSSS !
Thank's
How do we make this symbol (")
on the other hand the result is not saved in the fields ???
Great, thank your very much It works, it calculates the nights.....so nice.
I still have the same problem than joecocs, that the calculated value is not saved, it just saves a zero. I also tried to download and substitute the nuform.php file, it didn´t help.
Should the calculated nights-field be a nunumber? Or only number, and which format should the column in mysql have, INT (3) ?
Thank you. Best regards.
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 476 times
- Contact:
Re: How to subtract dates to calculate nights
The important thing is to call change() after setting a value.
INT (3) should work and also nuNumber / Number.
Code: Select all
$('#your_field').val("xxx").change();
-
- Posts: 15
- Joined: Sat Feb 01, 2020 4:04 pm
Re: How to subtract dates to calculate nights
Sorry, where do I insert that $('#your_field').val("xxx").change(); code?
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 476 times
- Contact:
Re: How to subtract dates to calculate nights
Just read through this topic, starting here:faroinsua wrote:Sorry, where do I insert that $('#your_field').val("xxx").change(); code?
https://forums.nubuilder.cloud/viewtopic. ... 251#p20421