SAP CAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 
qmacro
Developer Advocate
Developer Advocate
2,057

At the CAP-level, support for multiple databases is available (SQLite, Postgres, HANA, H2). This support includes standard operators and standard functions, portable across the database runtimes. There are various functions in this set, across different categories:

  • String (concat, length, trim, ...)
  • Numeric (ceil, floor, round, ...)
  • Aggregate (avg, min, max, ...)
  • Date / Time (date, time, year, ...)

In this last category, what is the name of the function for calculating the number of years between two dates?

This is a question from the June Developer Challenge on CAP Knowledge. And don't forget: always submit your answer as a hash, on its own - read the Taking part section of the intro post for more info. At the end of today, this question will be updated with links to further reading on this topic.

Further info:

48 Comments
VishnAndr
Active Contributor
0 Likes

355b6e9db02ae95fbab1a4454e18d1957ff1a816642e046e9cf6e5b7b35fc44d

PrabhuDC
Explorer
0 Likes

941b8d13bdd214f9a04435b9e1930ba13c21c8c056c3e84b5ad8ec5d90b32759

shotokka
Explorer
0 Likes

4b9a47fd204377ffae07aa72f5eed28f76da15ebb42320aca350a236141f2fc7

HarshPatelV
Participant

Interesting challenge that encourages deeper exploration of CAP database portability features. Understanding date and time functions is highly relevant in real SAP applications where reporting, analytics, and lifecycle calculations depend on consistent behavior across supported databases, helping improve maintainability and reducing database specific implementation effort.

furkan5
Participant
0 Likes

ee248226e50f1e76d4f885b998d441d92a0224748a11a9a2e80a2666356345e5

berkaydurmaz
Explorer
0 Likes

62bb95c07eb1b6a75e869f33efc47d6841f1e8c25d1a979b015cedc1e3fc72f8

kasch-code
Participant
0 Likes

e0991775ece4eccb6c99e67491691a8fd3eb095aca68d93fc33291236d6e853a

SachinArtani
Active Participant
0 Likes

13a7b29d1d20fc6a7ffc781d0996c9f954a34ce711965486f1617a02a2a7da2d

NakulG
Explorer
0 Likes

73e74410c0d1f3cdf76369870fc13a6d78a155ad6bdf5589084e70809c711342

ajmaradiaga
Developer Advocate
Developer Advocate
0 Likes

223790792c2e9744c55347987142ea1981d8e44eb7135058c6619bf24429999f

Rupesh_Kumar25
Explorer
0 Likes

66672f6960e0a9b14471e4c0d35b847f21109c5abdaba31dc3ae30b88c226772

Chaimae_Chairi27
Participant
0 Likes

16fb658454a44ee1f643e48d7363a2d6030c46e783f3608a5523afb6ca46db7b

mvaibhav
Contributor
0 Likes

8e0a18ea561212cf650669b2f3b160f2a85a9f1ac4cad09784eafd5fe675c3b6

Joery
Participant
0 Likes

a3d232e5bd2a39cb9a6130ca171f180cdf5455757e2c4ffd6bc833acbedff35f

ditt_kalyan
Explorer
0 Likes

cfdb17a1d1bc960d5b61b85fd14576939a6c83f3e4e1a08864973f6d775db5d3

SergioG_TX
SAP Champion
SAP Champion
0 Likes

2d7942b76d80ca76bf86dc2eeb6f2816415777f1a6c65f58a6f86192286be747

MatLakaemper
Participant
0 Likes

c8a424771417442fdbe39e95c11ea136e2e4b8bd156e53bef8bf919ba4620737

JFenris
Explorer
0 Likes

53eea8c5768f1fbe1816617b9c76083827422287aa6ec6cb1ea38f11164f3864

ankitsrivastav
Explorer
0 Likes

a7d8f16bd8856abb7497ecda49171bdef91ca707002fe81a85115ba733e1cf06

Caisi
Explorer
0 Likes

80134c745d0db06d392a820bb2e894f0b5f53b189965ff7ce688951c352cb47b

sarvesh_agarwal
Explorer
0 Likes

fb508e523b4b3c85dc5082cff754b5e44729ace2e1671b66a0ee7f37370ba3b9

MioYasutake
SAP Champion
SAP Champion
0 Likes

005c2df28355c030598b528277d24ad3b5cfae74a6d4326f2174c4c266be0da0

RajeshOlive
Explorer
0 Likes

0abae78d6b93536602be34ba7a07d422ef8a6604af3345b69c0fdc96a9f485da

AfshanAnsari
Explorer
0 Likes

23e73f86239ca780a552b0b9c1ccc2f4d2fa4c10211a6df384b8f05896cae203

lidavidlee
Explorer
0 Likes

d6fea1f98f660d793f29e9aa0e38a78aba3df610b5960f4610bc0a113f6353e2

omer_sakar
Active Participant
0 Likes

52e55fdd57e66f4a76270dc3ce8a4faa30405e5a5c73aeecaca66c36af1b0dd0

aryan-11
Explorer
0 Likes

a6804a6505ee4214583289f7627debc2334d999ae7b173aeba5c5abe4784949d

tobiasz_h
Active Participant
0 Likes

07bb5054549177d136cd761121587aacda87fed3c869543af192f5c3339c3d94

milan_10
Participant
0 Likes

43f5dcaee1490bbc1a2426a7321e0a6c5881d4a584c09bc30892c87d085ce70a

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Likes

9295d8e3b08a9037df2003b25d9b2b37ee68c41ab51ee0519a44dcebb4498f7d

0 Likes

882bc48b946b0693a970ab386aeeb9e5511623e4e7e4504d0bc800f2b05ea1ee

parthasaradhi
Explorer
0 Likes

28f1969fda58803d2f83da966adecc71ae999a4921710f68077d0b7623009a43

soheil_st
Explorer
0 Likes

3c178de226bebd69ed4753d009e1a47fe59e11be7cc4f7913e080bee0d8e5931

Andrii
Participant
0 Likes

a1e3690748511902faf849811cf3496ddbada7903bcb828df3f73b5738e3375d

nagarjundas_1994
Explorer
0 Likes

da237fcb37ed07ad3dfd3cb098bac47186e4eb428503f1e96149651443fce55b

YLN
Explorer
0 Likes

fe0e90674f1a5c4908885f7b2e72cdbc05e207a95ef98f249d01b086ea70ff3b

aelghannam
Participant
0 Likes

caa83b73ab14f9822c21c8d7ff93488eedad661f13cc1dadb93b14b4913bb4d6

GauravPhadnis
Product and Topic Expert
Product and Topic Expert
0 Likes

7092c90e80bbbeeae92451ffe49a6209a35f188883b3e7eb4d7f3ff6884a5b8c

Ihor_Haranichev
Participant
0 Likes

11ff6d37bbde7dfa3cb539cdbc618508789bdc583bdd6f1906ce7f947d3e5004

Guru_Charan
Explorer
0 Likes

d65e58566f52346a9e66f2eb1e71c9127591c44fd40e093225756750a53a46c8

stickman_0x00
Participant
0 Likes
5e366b275f78c5cacf2435126a819e1c1fd0b55e965620dbd3ba7119cf323f20
Swathi_SAP_Philomath
Participant
0 Likes

efe326cbe4d1eec5ec7a3b396d3c9486258e95be1d44e2a14f3d6d1671dd8bf6

Laco
Participant
0 Likes

01384ff4db1f361279c212822967c6491d66fe04ea4038804d83ccfdca4a8d98

NeelimaEmmani
Explorer
0 Likes

a6eb84693d56e6fe8519e14cf27e21fe9e8da551e8d8af4ebb1b982539405ef0

Anusha2025
Explorer
0 Likes
c0d02e1b2a5182bdae3c593966be3f93223fc2931aa84a4d187a5e5cfb3ffc3d
mhameister
Explorer
0 Likes

2f64e4aace9d7c3e9629b259b33c239b8f0171e4454fb2d5f486c94bce883aee

gouthamKumar
Explorer

8cf71d6131cd4c1ba25d860a2d6315c1f5e1329d7ce33a1d5f7a04a181b7fe40

0 Likes

fb4cef21ee37a098cf17c3b28d730355df954668e044d7c6904f05d67cf1a702