Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My table punching have columns named EMPID, DATE, PMODe, PTIME.. I want to insert multiple values separated by comma in PTime column if value of EMPID, DATE and PMODE have same data.


I am using Front End as Visual Basic 6.0..
Posted

Never put multiple values in a single column in a row. It can but should not be done. It is against 1NF principle. In relational database design, every row must not have a column that takes more than one value, like separated with commas. They should be separated into multiple rows.
Read more: ten-common-database-design-mistakes/[^]
 
Share this answer
 
v3
Don't insert comma separated values unless absolutely necessary.
Have individual fields for each of those comma separated values.
 
Share this answer
 
you may change the field data type to text or something which can accept text data and then each time a new entry arrives, read the current data and append it with new value and update the field.

Note: This will not break 1NF

Disadvantages:
1) You have lost the meaning of time. You will not be able to do any meaningful operations with this data until you parse it back to individual time entries.

2) You may encounter data quality issues( format is messed up, text is encountered where number is expected etc...)

The bottom line is: You should know what you are doing here :D
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900