I have looked into Cast and Convert, but I cannot find a way to do this. I need to convert four digits into an hour format. For instance, 0800 would become 8:00 or 1530 would become 15:30. I cannot use functions, I'm using a special form of SQL. Any suggestions? Thanks in advance!
PhilEaton 0 Newbie Poster
Recommended Answers
Jump to PostYeah do this with a scripting language. I doubt you have the functionality in SQL.
For eg PHP might be
public function convertTime($var) { $tm = ""; $tm = $tm . substr($var, 0, 2); $tm = $tm .(":"); $tm = $tm . substr($var, 2,4); $tmp = …
All 4 Replies
PhilEaton 0 Newbie Poster
PhilEaton 0 Newbie Poster
BitBlt 452 Practically a Master Poster Featured Poster

iamthwee
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.