Click here to Skip to main content
15,887,915 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm having a gridview and i want to add 2 column time and display in 3rd column
I'm having the column name is ScheduleArrival and datatype is nvarchar(50) and im storing in that column is time like 11:15 and another column is Late the datatype is also nvarchar(50) and also storing the time like 12:25.
The thing is that i want to add both the times and display in 3rd column that is Late2
plz help me for this

What I have tried:

Update TrainMaster Set Eat = Late + Late2 + ScheduleArrival where TID= @TID
This is my query plz help
Posted
Updated 28-Jun-18 20:14pm
v2
Comments
OriginalGriff 29-Jun-18 2:09am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. So we have no idea what your DB looks like, or what you want to see on the screen. Plus, UPDATE queries don't display anything - they change the DB content.
So show us the table with sample data, and show us what you want to see on screen.
Then explain what you have tried, and why it didn't do what you wanted.

Use the "Improve question" widget to edit your question and provide better information.
Shahbaz435 29-Jun-18 2:10am    
kk sir
Richard Deeming 29-Jun-18 9:33am    
NEVER store dates or times in string columns. Use one of the dedicated date/time data types[^] instead. In this case, you need the time[^] type.

Also, it makes no sense to add two times together. Even adding a number of hours to a time is dubious without the date and timezone information, since you can't take DST into account.
Shahbaz435 30-Jun-18 1:14am    
so how should i do that plz suggest me sir im new in sql

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