• Vegeta7 - Sunday, October 22, 2017 6:08 AM

    Thank you very much for your answer Thom A !
    To answer your points:
    1) I live in Europe and I guess it's the inverse from the US 🙂 here we use commas to mark the decimal points. This happens in excel, for example, although I think it in SQL Server it uses dots, so I will work on that conversion.
    2) Because of the above I didn't use int or decimals, but I will surely change that now 🙂
    3) The dates in Europe are always dd-mm-yyyy. And for some reason, I had to write mm-dd-yyyy in the script to get to dd-mm-yyyy in SSMS. Confusing I know, and apologies for that.
    4) I agree with both of you, thank you for pointing this out to me Thom A and DesNorton 🙂 I really appreciate it!

    Thanks again Thom A, I ran your query and this is the answer I was looking for 🙂 I have 2 extra columns and I understand why they are there and I will try to exclude them, but nonetheless, this is exactly what I was looking for 😀

    I'm European. Numbers use periods, not commas. 😉

    In regards to your dates Im guessing your language is set to English, rather than British, French, German (other European language). Hence dates in dd-MM-yyyy are read as MM-dd-yyyy. SQL Server reads date strings in the format yyyy-MM-dd as yyyy-dd-MM, regardless of your language setting. I believe this is a "feature". Hence I generally use the format yyyyMMdd (without the hyphens) when passing dates. This means there is no confusion, especially across laguages.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk