Jump to content
  • 0

date when checkbox is checked


DRAhmed

Question

9 answers to this question

Recommended Posts

  • 0
1 hour ago, DRAhmed said:

how can i  make the date of the check automatically entered when a checkbox is checked 

i used a calculated field using this formular 

i use a custom time zone in localization 

Case 
WHEN [@field:arrived_at_company]= 1
Then GETUTCDATE()
End

but it still returns utc time instead of the required time zone

 

Link to comment
Share on other sites

  • 0

Hi
You can try the following code:
You can change the GMT Standard Time with your desired Time Zone.
You can as well change the '100' format to desired one, you can chose from one of these options: https://www.w3schools.com/sql/func_sqlserver_convert.asp

Case 
WHEN [@field:arrived_at_company]= 1
Then (SELECT CONVERT(VARCHAR, CONVERT(DATE, GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'GMT Standard Time'), 100) AS [Date_Result])
End

Link to comment
Share on other sites

  • 0
On 10/24/2022 at 3:51 PM, RagnarIllyrian said:

Hi
You can try the following code:
You can change the GMT Standard Time with your desired Time Zone.
You can as well change the '100' format to desired one, you can chose from one of these options: https://www.w3schools.com/sql/func_sqlserver_convert.asp

 

Case 
WHEN [@field:arrived_at_company]= 1
Then (SELECT CONVERT(VARCHAR, CONVERT(DATE, GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'GMT Standard Time'), 100) AS [Date_Result])
End

 

i did the formula like this 

Case 
WHEN [@field:arrived_at_company]= 1
Then (SELECT CONVERT(VARCHAR, CONVERT(DATE, GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'Egypt Standard Time'), 113) AS [Date_Result])
End

 

but it shows this 

incompatible data type. The result of the formula is Text (255) but must be Date/Time.

and also the result returned i zeros in the time place

Link to comment
Share on other sites

  • 0
On 10/24/2022 at 3:51 PM, RagnarIllyrian said:

Hi
You can try the following code:
You can change the GMT Standard Time with your desired Time Zone.
You can as well change the '100' format to desired one, you can chose from one of these options: https://www.w3schools.com/sql/func_sqlserver_convert.asp

 

Case 
WHEN [@field:arrived_at_company]= 1
Then (SELECT CONVERT(VARCHAR, CONVERT(DATE, GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'GMT Standard Time'), 100) AS [Date_Result])
End

 

i used a simple formula 

Case 
WHEN [@field:approved]= 1
Then DATEADD(hour, 02, SysUTCDateTime()) 
end

 

but the problem it shows the current date and time 

not when the checkbox is checked

Link to comment
Share on other sites

  • 0
On 10/29/2022 at 1:37 PM, DRAhmed said:

i used a simple formula 

Case 
WHEN [@field:approved]= 1
Then DATEADD(hour, 02, SysUTCDateTime()) 
end

 

but the problem it shows the current date and time 

not when the checkbox is checked

Indeed this will show the current DateTime when the approved field is checked.
I have used the same formula in this page:  https://c8cmr089.caspio.com/dp/02cab000dd25f0a542784ccaac8e
It works as expected

Link to comment
Share on other sites

  • 0
5 hours ago, RagnarIllyrian said:

Indeed this will show the current DateTime when the approved field is checked.
I have used the same formula in this page:  https://c8cmr089.caspio.com/dp/02cab000dd25f0a542784ccaac8e
It works as expected

but everytime i open the data page it generates a new time and date ( the current ) 

while it indeed saves the date and time when the checkbox is checked in the table 

in the data page it generate a new one everytime 

how to prevent that ?

Link to comment
Share on other sites

  • 0
13 hours ago, Meekeee said:

Hi @DRAhmed - what is your expected result? Do you have sample data?

i found a way around using virtual field set to autovalue or autocomplete , dont really remember 

and it shows data directly from table 

so yes the calculated field still show current date and time , the viirtual field shows directly from table 

i would like to ask if you can help with this 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...