Home > database >  Pb automatically take time digits
Pb automatically take time digits

Time:10-11

Do have a list of n - up style, in the database is (date) (month) (year), I want to implement form preview January 1st of each year (date) (month) (year), take no. 1 month day of each month, the rest of the days, only wanted to ask how to implement, please master to answer,

CodePudding user response:

Can the background SQL directly to you, or the front desk with computed columns

CodePudding user response:

Compute the column of

January 1st of each year (date) (month) (year), take no. 1 month day each month, take the rest of days

Assuming that the field is work_date, you can define a computed columns, expression is

If (string (work_date, 'MM - DD)=' 01-01, string (work_date, '- DD YYYY - MM), the if (string (work_date,' DD ')='01 ", string (work_date,' MM - DD), string (work_date, 'DD')))

Have a try

CodePudding user response:

Many methods:
1, don't know what you use database, general database support the view that the way you can use the view into data format you want, can be read directly program,
2, read directly from the table, generally use SQL statements to realize the transformation,
3, the advantages of PB is a data object, but through the moderator said, computed columns,

See you like that kind of,
So I tell you, if the database supports transformation, efficiency is the highest, after all, data conversion,
Transformation on the PB end, must have a minimum efficiency, and lower, is line processing,
If you have a little amount of data, it doesn't matter what kind of way,
  • Related