Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date calculation needed

Featured Replies

May I ask, I'm making database with ID, DATE and NAME, but I want if I input DATE for example day(2digit),month(2digit)and year(4digit) and I enter it will be automatic in the ID it say year(4digit)month(2digit)day(2digit) and there is 0001 behind day. for example date:25-02-2022 if I enter the ID must be like 20220225-0001 it will be like that and automatically sequentially.

sorry if my English is not good. I'm Dedy from Jakarta, Indonesia

8 hours ago, D3D1 said:

if I enter the ID must be like 20220225-0001 it will be like that and automatically sequentially.

I don't understand this part. If you want sequential ID, then you (as the user) cannot be entering your own.

Also, it's not clear what exactly "sequential" means here. Do you want to restart the sequence at the beginning of each day? If so, you are looking at further complication, because Filemaker does not have a built-in mechanism for this. Is your solution hosted on FM Server?

 

  • Author

if I press New Record and fill  in the DATE column automatically in a written ID as I give the image. without to fill in ID manually.

thank you

dedy

Screen Shot 2022-02-26 at 15.45.03.png

Untitled.fmp12

56 minutes ago, Steve Martino said:

Simple version

The date part of your calculation does not distinguish between Jan 21 and Dec 1 (for example). The correct expression for a 6-digit YYMMDD result, as indicated in the question, would be:

Right ( Year ( date ) ; 2 ) & SerialIncrement ( "00" ; Month ( date ) ) & SerialIncrement ( "00" ; Day ( date ) )

or, if you prefer:

SerialIncrement ( "000000" ; 10^4 * Mod ( Year ( date ) ; 100 ) + 10^2 * Month ( date ) + Day ( date ) )

 

Edited by comment

20 hours ago, comment said:

The date part of your calculation does not distinguish between Jan 21 and Dec 1 (for example). The correct expression for a 6-digit YYMMDD result, as indicated in the question, would be:

Right ( Year ( date ) ; 2 ) & SerialIncrement ( "00" ; Month ( date ) ) & SerialIncrement ( "00" ; Day ( date ) )

or, if you prefer:

SerialIncrement ( "000000" ; 10^4 * Mod ( Year ( date ) ; 100 ) + 10^2 * Month ( date ) + Day ( date ) )

 

Nice!

  • Author

thank you for help me

  • Author

what if from 2022 to 2023 but the id of the number 0001 is again like the beginning again, for example the id becomes 230101-0001

  • Author
On 2/27/2022 at 1:06 AM, comment said:

The date part of your calculation does not distinguish between Jan 21 and Dec 1 (for example). The correct expression for a 6-digit YYMMDD result, as indicated in the question, would be:

Right ( Year ( date ) ; 2 ) & SerialIncrement ( "00" ; Month ( date ) ) & SerialIncrement ( "00" ; Day ( date ) )

or, if you prefer:

SerialIncrement ( "000000" ; 10^4 * Mod ( Year ( date ) ; 100 ) + 10^2 * Month ( date ) + Day ( date ) )

 

I will try my best, thank for your help 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.