Jump to content
  • 0

Need to compare values (data) in two colums same table


Mirko

Question

Hi all,

I would like to ask your support, i have to introduce a control to compare values in same table. If colums 'date' and colum 'hours' contain the same value like 01/01/2023 12.00am I want to receive a warning message or email or any action tha make me aware about this condition. 

Do you have any idea how to introduce this control?
Thanks and regards

Mirko

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi @Mirko

You could maybe add another column in your table, named Status or similar. Make this field Formula Field. Add a formula where it checks: if colums 'date' and colum 'hours' contain the same value like 01/01/2023 12.00am and set a status to warning or something similar.
You could now use a task to run on demand or daily to send a message with the records where status is Warning.
You could also highghlight the rows in red a DataPage Report where the status is Warning. See this post how to do it: 

 

Link to comment
Share on other sites

  • 0
On 1/23/2023 at 9:25 AM, RagnarIllyrian said:

Hi @Mirko

You could maybe add another column in your table, named Status or similar. Make this field Formula Field. Add a formula where it checks: if colums 'date' and colum 'hours' contain the same value like 01/01/2023 12.00am and set a status to warning or something similar.
You could now use a task to run on demand or daily to send a message with the records where status is Warning.
You could also highghlight the rows in red a DataPage Report where the status is Warning. See this post how to do it: 

Thanks a lot for you reply and suggestions. I am a newbie with Caspio solutions so I have checking out forum , help section and video tutorials. Unfortunately I am not a developer too :-) so it isn't so simple as I hope, but step by step I am go ahead. 

I understood how to create a Function field in table but I do not know the correct syntax to use and any attempt to write a CASE , WHEN etc etc failed. 
My goal should be to create a Table Column named 'Status' and apply a formula to fill the field like 0 or 1 according with the two columns DATE and HOUR compared (Where =)


Example;
ID,DATE|HOUR|STATUS(formula)
01,01-01-2023,12:00,1
02,01-01-2023,12:00,1
03,02-02-2023,12:00,0
04,03-04-2023,12:00,0
05,04-04-2023,12:00,0

May you please if do not mind provide what formula would you use to achive the above example?
Thanks in advance for any further insight!
Regards
Mirko



 

 

Link to comment
Share on other sites

  • 0
17 hours ago, Mirko said:

Example;
ID,DATE|HOUR|STATUS(formula)
01,01-01-2023,12:00,1
02,01-01-2023,12:00,1
03,02-02-2023,12:00,0
04,03-04-2023,12:00,0
05,04-04-2023,12:00,0

Hi Mirko,

In this example 
01,01-01-2023,12:00,1
02,01-01-2023,12:00,1

Is set to one, but why  05,04-04-2023,12:00,0 or 03,02-02-2023,12:00,0 is not set to 1?

A example where you check for these values can be:
 

Case 
WHEN Day([@field:Date1]) = 01 AND Month([@field:Date1])=01 AND [@field:YourTimeField] = '12:00' THEN '1' 
ELSE
'0'
END


Change the field Date1 according to your field. 
I am not sure how you have set up your time field, but you can try that. If that does not work, try to use it without the comparing the time.
Let me know how do you get your time stored? Is it a different column? What format is the time stored in the field?

Link to comment
Share on other sites

  • 0

Hi,  thanks for you support, please let me to explain better my needs.

I ve a table where all fields are Text formatted,  I would like to prevent user  to insert new rows that matching with the existing value present in 3 columns.
example  the two rows have a duplication state, Casa, Data and Ora matched in the below table example.  So I should not be able to insert the second row as the 3 fields already existing having the same values. 
I do not know if possible to implement this control in table, prevent to inserting or alert me when this condition matched as I do not have Trigger Action Table in free license.

 Otherwise another scenario could be, when the 3 values are equal Then write a value in Duplicated field like Y or '1' so I can at least sort them out with search field into the DataPage Report and then deleted or correct row manually in the table, it's not good but it is better than nothing! 


 image.png.7adcbd4ab04ebe5e72fec53b5a9eeae7.png

Does it make sense what I m looking for? 

Thank you for any further support and suggestions.

kind regards
 

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...