Prevent the creation of another data entry in a given day

This seemed so easy, but when it came to doing it, I got stuck lol.

Maybe it is easy, and I’m being dumb.

Anyone know how to prevent the creation of another data entry on a given day. So, for example, you can only create one data entry per given day, and this resets every day.

Hey @johnny

Mark a date on it ‘rounded down to day’. Then check if it already exists.

Makes sense?

Let me know if you need more direction or an example. :blush:

1 Like

you can also save a date on the user, and allow data entry creation when (current date/time - 24 hours) > the user's saved date

1 Like

Of course! :grinning_face_with_smiling_eyes: :sweat_smile:

Thanks guys :slight_smile:

1 Like

@johnny No worries. Knew you would get it. :raised_hands:

1 Like

orrrr maybe not lol… I’m here:

Screenshot 2022-04-18 at 21.33.13

Why’s everyone rounding, when you can just extract the day/date from any date input?

What I want is the actual date, so just 4/18/2022 12:00 am. Since I want it to reset everyday at midnight. When you do day: you would get 1, when you do date you would get 18

When you round down, you’re able to achieve just that, but I want to round down on both dates (current & other) I’m comparing so if they’re the same then I know we are still on the same day and if it’s not then we’re onto the next date. If that makes sense…

And I’m avoiding Danny’s method because I want it to reset everyday at midnight instead of 24 hours since the last entry was created.

For context: My use case is for attendance. If attendance has been submitted for a given day, then they can still update for that given date, but when it comes the next day, they can take attendance for the next day.

1 Like

@johnny Just round it down to day when you save the date in the database. Don’t try to round it in the condition. The current date and time will be rounded down to date. Does that make sense? :blush:

@ken2 I have used it before to do a running streak as well. Need to check and see if something happened during the day at any time not within the last 24 hours.

@j805 www.NoCodeMinute.com

For All Your No-Code Education Needs:

1 Like

Thanks, @J805! If anyone needs a reference, this is what I did

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.