Recent

Author Topic: [SOLVED] Conditional creation of tables  (Read 1075 times)

madref

  • Hero Member
  • *****
  • Posts: 1078
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
[SOLVED] Conditional creation of tables
« on: August 18, 2023, 04:46:01 pm »
Is it possible to create tables depending on which year it is?
with something like
Code: Pascal  [Select][+][-]
  1. {ifdef....}
« Last Edit: August 25, 2023, 03:14:42 am by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Sonoma 14.7
Lazarus 3.99 (Lazarus 3.99 (rev main_3_99-2668-g6b352d830e) FPC 3.3.1 x86_64-darwin-cocoa)

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Conditional creation of tables
« Reply #1 on: August 18, 2023, 05:30:16 pm »
What do you mean?
Isnt it enough to "FormatDateTime('yyyy', Now)" ?
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Zvoni

  • Hero Member
  • *****
  • Posts: 2738
Re: Conditional creation of tables
« Reply #2 on: August 21, 2023, 11:08:52 am »
Is it possible to create tables depending on which year it is?
with something like
Code: Pascal  [Select][+][-]
  1. {ifdef....}

Conditional from FPC/Lazarus, or conditional from SQL?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

RayoGlauco

  • Full Member
  • ***
  • Posts: 193
  • Beers: 1567
Re: Conditional creation of tables
« Reply #3 on: August 21, 2023, 12:42:50 pm »
More elaboration needed.
You may write this, but I think you want to do something else:
Code: Pascal  [Select][+][-]
  1. if YearOf(Date)=2023 then
  2.   // create a table
  3.  
To err is human, but to really mess things up, you need a computer.

madref

  • Hero Member
  • *****
  • Posts: 1078
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Conditional creation of tables
« Reply #4 on: August 25, 2023, 03:14:28 am »
it was a good question but a not so relevant one.
but thanks for the answers
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Sonoma 14.7
Lazarus 3.99 (Lazarus 3.99 (rev main_3_99-2668-g6b352d830e) FPC 3.3.1 x86_64-darwin-cocoa)

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

 

TinyPortal © 2005-2018