Page 4 of 5

Re: How to subtract dates to calculate nights

Posted: Mon Feb 24, 2020 9:13 pm
by kev1n
1000 * 60 * 60 *24 * 365.25 / 12

is the same as

2000 [ which is 24/12*1000 ] * 3600 * 365.25

Re: How to subtract dates to calculate nights

Posted: Mon Feb 24, 2020 9:26 pm
by kev1n
joecocs wrote:
===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)
Can it have a consequence?
Update nuBuilder (or just replace nuform.php https://github.com/steven-copley/nubuil ... nuform.php) and the error will be gone.

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 11:03 am
by joecocs
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

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 11:26 am
by kev1n
What date format are you trying to set?

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 11:27 am
by joecocs
dd/mm/yyyy

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 11:35 am
by kev1n
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.

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 4:03 pm
by faroinsua
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.

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 4:11 pm
by kev1n
The important thing is to call change() after setting a value.

Code: Select all

$('#your_field').val("xxx").change();
INT (3) should work and also nuNumber / Number.

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 5:29 pm
by faroinsua
Sorry, where do I insert that $('#your_field').val("xxx").change(); code?

Re: How to subtract dates to calculate nights

Posted: Tue Feb 25, 2020 6:35 pm
by kev1n
faroinsua wrote:Sorry, where do I insert that $('#your_field').val("xxx").change(); code?
Just read through this topic, starting here:
https://forums.nubuilder.cloud/viewtopic. ... 251#p20421