Click here to Skip to main content
15,889,096 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: What Version Is My C# Compiler? Pin
Nish Nishant21-Aug-18 9:57
sitebuilderNish Nishant21-Aug-18 9:57 
GeneralRe: What Version Is My C# Compiler? Pin
Nelek21-Aug-18 10:05
protectorNelek21-Aug-18 10:05 
GeneralRe: What Version Is My C# Compiler? Pin
David A. Gray21-Aug-18 10:34
David A. Gray21-Aug-18 10:34 
GeneralRe: What Version Is My C# Compiler? Pin
Richard Deeming21-Aug-18 10:40
mveRichard Deeming21-Aug-18 10:40 
GeneralRe: What Version Is My C# Compiler? Pin
Nish Nishant21-Aug-18 10:47
sitebuilderNish Nishant21-Aug-18 10:47 
GeneralRe: What Version Is My C# Compiler? Pin
Richard Deeming21-Aug-18 10:54
mveRichard Deeming21-Aug-18 10:54 
GeneralRe: What Version Is My C# Compiler? Pin
Nish Nishant21-Aug-18 10:58
sitebuilderNish Nishant21-Aug-18 10:58 
GeneralQlikview - a real pleasure to work with Pin
#realJSOP7-Aug-18 4:05
mve#realJSOP7-Aug-18 4:05 
I created a datetime variable like so

C#
LET vTEST = '2018-09-05 13:27:14.5';


Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:

C#
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF')                                           = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')                                  = "2018-09-05" <======== THIS is what I wanted


A Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the FLOOR function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example.

Have I mentioned how much I hate working in Qlikview?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: Qlikview - a real pleasure to work with Pin
Slacker0077-Aug-18 4:24
professionalSlacker0077-Aug-18 4:24 
GeneralRe: Qlikview - a real pleasure to work with Pin
Richard Deeming7-Aug-18 4:53
mveRichard Deeming7-Aug-18 4:53 
GeneralRe: Qlikview - a real pleasure to work with Pin
ZurdoDev7-Aug-18 6:27
professionalZurdoDev7-Aug-18 6:27 
GeneralRe: Qlikview - a real pleasure to work with Pin
Jörgen Andersson7-Aug-18 8:13
professionalJörgen Andersson7-Aug-18 8:13 
GeneralRe: Qlikview - a real pleasure to work with Pin
Vincent Maverick Durano10-Sep-18 8:01
professionalVincent Maverick Durano10-Sep-18 8:01 
GeneralRe: Qlikview - a real pleasure to work with Pin
Marc Clifton7-Aug-18 14:45
mvaMarc Clifton7-Aug-18 14:45 
GeneralRe: Qlikview - a real pleasure to work with Pin
OriginalGriff7-Aug-18 19:36
mveOriginalGriff7-Aug-18 19:36 
GeneralRe: Qlikview - a real pleasure to work with Pin
kmoorevs8-Aug-18 7:32
kmoorevs8-Aug-18 7:32 
GeneralRe: Qlikview - a real pleasure to work with Pin
raddevus8-Aug-18 9:25
mvaraddevus8-Aug-18 9:25 
GeneralRe: Qlikview - a real pleasure to work with Pin
Sander Rossel13-Aug-18 9:01
professionalSander Rossel13-Aug-18 9:01 
GeneralRe: Qlikview - a real pleasure to work with Pin
Stefan Küsters7-Aug-18 20:32
Stefan Küsters7-Aug-18 20:32 
GeneralRe: Qlikview - a real pleasure to work with Pin
Worried Brown Eyes8-Aug-18 22:53
Worried Brown Eyes8-Aug-18 22:53 
AnswerRe: Qlikview - a real pleasure to work with Pin
Mark Miller21-Nov-18 6:34
Mark Miller21-Nov-18 6:34 
GeneralNature tester PinPopular
Smart K826-Jul-18 1:28
professionalSmart K826-Jul-18 1:28 
GeneralRe: Nature tester Pin
Peter_in_278026-Jul-18 1:33
professionalPeter_in_278026-Jul-18 1:33 
GeneralRe: Nature tester Pin
Smart K826-Jul-18 1:47
professionalSmart K826-Jul-18 1:47 
GeneralRe: Nature tester Pin
Super Lloyd30-Jul-18 19:46
Super Lloyd30-Jul-18 19:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.