Hello,
1. To enter a
NULL value for date:
If you are using a PM Table, you need to tick the NULL column of the date field of your table. This will allow the field to store the NULL value.
In a trigger, check the value of variable x and fire the query accordingly. If you pass a value for the date, it will be set to that value. You can refer the following query:
Code: Select allINSERT INTO PMT_MY_TABLE (NAME, PLACE, DATE) VALUES ('$name', '$place', '$date');
To set the value of the date as NULL, you can refer the following SQL query:
Code: Select allINSERT INTO PMT_MY_TABLE (NAME, PLACE) VALUES ('$name', '$place');
2. To enter
date plus time in database:
Take the DateTime field(say
date1) in the grid(say
gridVar001) and set its format to :
YYYY-MM-DD, h:mm:ss
In the database take the DATE field of type DateTime.
And create a trigger which gets the value the
date1 field of the grid and stores in the database.
An example of trigger can be as follow:
Code: Select all@@d = @@gridVar001[1]['date1'];
$date1 = @@d;
$query = "INSERT INTO PMT_MY_TABLE (NAME, PLACE, DATE) VALUES ('name', 'place', '$date1')";
@@res = executeQuery($query);
Hope this helps
Best Regards
Mishika