April 19, 2017 at 6:55 am
mw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!
'NO', in other words.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
April 19, 2017 at 7:10 am
Phil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
April 19, 2017 at 7:40 am
mw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
--Jeff Moden
Change is inevitable... Change for the better is not.
April 19, 2017 at 8:07 am
Jeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
April 19, 2017 at 8:09 am
Lynn Pettis - Wednesday, April 19, 2017 8:07 AMJeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
112 is a formatting constant that gives the YYYYMMDD format ( That was easy ) , the 0 and -1 is used in the DateDiff and DateAdd function to calculate. Cool! Thanks!
April 19, 2017 at 9:13 am
mw112009 - Wednesday, April 19, 2017 8:09 AMLynn Pettis - Wednesday, April 19, 2017 8:07 AMJeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
112 is a formatting constant that gives the YYYYMMDD format ( That was easy ) , the 0 and -1 is used in the DateDiff and DateAdd function to calculate. Cool! Thanks!
First part, the 112, but there is more to the 0 and -1. Can you explain what they are doing, why it gives you the answer to your question. Based on what you just wrote, I am not sure you really do.
April 19, 2017 at 9:34 am
Lynn Pettis - Wednesday, April 19, 2017 9:13 AMmw112009 - Wednesday, April 19, 2017 8:09 AMLynn Pettis - Wednesday, April 19, 2017 8:07 AMJeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
112 is a formatting constant that gives the YYYYMMDD format ( That was easy ) , the 0 and -1 is used in the DateDiff and DateAdd function to calculate. Cool! Thanks!
First part, the 112, but there is more to the 0 and -1. Can you explain what they are doing, why it gives you the answer to your question. Based on what you just wrote, I am not sure you really do.
Adding to that, mw112009 do you understand what DATEDIFF and DATEADD do?
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 19, 2017 at 10:04 am
bmg002 - Wednesday, April 19, 2017 9:34 AMLynn Pettis - Wednesday, April 19, 2017 9:13 AMmw112009 - Wednesday, April 19, 2017 8:09 AMLynn Pettis - Wednesday, April 19, 2017 8:07 AMJeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
112 is a formatting constant that gives the YYYYMMDD format ( That was easy ) , the 0 and -1 is used in the DateDiff and DateAdd function to calculate. Cool! Thanks!
First part, the 112, but there is more to the 0 and -1. Can you explain what they are doing, why it gives you the answer to your question. Based on what you just wrote, I am not sure you really do.
Adding to that, mw112009 do you understand what DATEDIFF and DATEADD do?
Thank you good teachers for checking my knowledge...
bmg002- 🙂 Your question was too easy .. ha ha
Here you go Lynn: This is a quick reply I am sure you we dont need the details here.
Instructions for FirstOfPrevMonth
1.) Get # of Months from 1900/01/01 to currentDate ( This is an integer ) using DATEDIFF(MM, 0, GETDATE())
2.) Subtract 1 ( THAT WILL TAKE US TO THE PREVIOUS MONTH )
3.) DATEADD(MM, [], 0) gives the first date of the month ( In this case MARCH 1, you added months from 1900/01/01 to March 2017 )
4.) [] = DATEDIFF(MM, 0, GETDATE())
5.) Finally the CONVERT( VARCHAR(8), XXX, 112 ) converts it to the YYYYMMDD format
LastOfPrevMonth
1.) Select DATEADD(MM, DATEDIFF(MM, 0, GETDATE()), 0) - Gives the first date of the current month
2.) -1 takes you to the last date of the previous month
3.) Finally the CONVERT( VARCHAR(8), XXX, 112 ) converts it to the YYYYMMDD format
April 19, 2017 at 10:06 am
mw112009 - Wednesday, April 19, 2017 10:04 AMbmg002 - Wednesday, April 19, 2017 9:34 AMLynn Pettis - Wednesday, April 19, 2017 9:13 AMmw112009 - Wednesday, April 19, 2017 8:09 AMLynn Pettis - Wednesday, April 19, 2017 8:07 AMJeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
112 is a formatting constant that gives the YYYYMMDD format ( That was easy ) , the 0 and -1 is used in the DateDiff and DateAdd function to calculate. Cool! Thanks!
First part, the 112, but there is more to the 0 and -1. Can you explain what they are doing, why it gives you the answer to your question. Based on what you just wrote, I am not sure you really do.
Adding to that, mw112009 do you understand what DATEDIFF and DATEADD do?
Thank you good teachers for checking my knowledge...
bmg002- 🙂 Your question was too easy .. ha haHere you go Lynn: This is a quick reply I am sure you we dont need the details here.
Instructions for FirstOfPrevMonth
1.) Get # of Months from 1900/01/01 to currentDate ( This is an integer ) using DATEDIFF(MM, 0, GETDATE())
2.) Subtract 1 ( THAT WILL TAKE US TO THE PREVIOUS MONTH )
3.) DATEADD(MM, [], 0) gives the first date of the month ( In this case MARCH 1, you added months from 1900/01/01 to March 2017 )
4.) [] = DATEDIFF(MM, 0, GETDATE())
5.) Finally the CONVERT( VARCHAR(8), XXX, 112 ) converts it to the YYYYMMDD formatLastOfPrevMonth
1.) Select DATEADD(MM, DATEDIFF(MM, 0, GETDATE()), 0) - Gives the first date of the current month
2.) -1 takes you to the last date of the previous month
3.) Finally the CONVERT( VARCHAR(8), XXX, 112 ) converts it to the YYYYMMDD format
Did I pass the test then ?
April 19, 2017 at 11:16 am
mw112009 - Wednesday, April 19, 2017 10:06 AMmw112009 - Wednesday, April 19, 2017 10:04 AMbmg002 - Wednesday, April 19, 2017 9:34 AMLynn Pettis - Wednesday, April 19, 2017 9:13 AMmw112009 - Wednesday, April 19, 2017 8:09 AMLynn Pettis - Wednesday, April 19, 2017 8:07 AMJeff Moden - Wednesday, April 19, 2017 7:40 AMmw112009 - Wednesday, April 19, 2017 7:10 AMPhil Parkin - Wednesday, April 19, 2017 6:55 AMmw112009 - Wednesday, April 19, 2017 6:50 AMJeff Moden - Tuesday, April 18, 2017 8:31 PMAgreed. With that in mind, I have the answer that DesNorton posted below.... and with that, I'll ask mw112009 , do you have any questions on how or why it works?I already answered this .......in a previous reply ...( as stated below ). Thank You, Thank You.
Credit to DesNorton
Jeff: The dates are used as default values in a SSRS report. The preferred format is YYYYMMDD. So what Des provided helps!'NO', in other words.
yes Sir! No further help at this moment.
So you understand exactly what the "0", "-1", and "112" values are for?
Of course he does, it gives him the answer he needs. That is all that matters apparently. I had asked him the same question and never saw an answer.
112 is a formatting constant that gives the YYYYMMDD format ( That was easy ) , the 0 and -1 is used in the DateDiff and DateAdd function to calculate. Cool! Thanks!
First part, the 112, but there is more to the 0 and -1. Can you explain what they are doing, why it gives you the answer to your question. Based on what you just wrote, I am not sure you really do.
Adding to that, mw112009 do you understand what DATEDIFF and DATEADD do?
Thank you good teachers for checking my knowledge...
bmg002- 🙂 Your question was too easy .. ha haHere you go Lynn: This is a quick reply I am sure you we dont need the details here.
Instructions for FirstOfPrevMonth
1.) Get # of Months from 1900/01/01 to currentDate ( This is an integer ) using DATEDIFF(MM, 0, GETDATE())
2.) Subtract 1 ( THAT WILL TAKE US TO THE PREVIOUS MONTH )
3.) DATEADD(MM, [], 0) gives the first date of the month ( In this case MARCH 1, you added months from 1900/01/01 to March 2017 )
4.) [] = DATEDIFF(MM, 0, GETDATE())
5.) Finally the CONVERT( VARCHAR(8), XXX, 112 ) converts it to the YYYYMMDD formatLastOfPrevMonth
1.) Select DATEADD(MM, DATEDIFF(MM, 0, GETDATE()), 0) - Gives the first date of the current month
2.) -1 takes you to the last date of the previous month
3.) Finally the CONVERT( VARCHAR(8), XXX, 112 ) converts it to the YYYYMMDD formatDid I pass the test then ?
Looks correct to me.
And I wasn't trying to sound condesending or anything, just wanted to be sure you did understand everything that everyone was saying. Getting the correct answer is important, but understanding the correct answer is a LOT more important. Otherwise you cannot support it in the future.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 19, 2017 at 2:35 pm
mw112009 - Wednesday, April 19, 2017 10:06 AMDid I pass the test then ?
"It Depends" on the next time you need to do such a thing. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
April 20, 2017 at 7:54 am
Thom A - Tuesday, April 18, 2017 9:38 AMHave you ever heard the proverb "give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime"?
Teach a man to build a fire and he'll be warm for a night. Set a man on fire and he'll be warm for the rest of his life.
(sorry, having a cynical day today :Whistling:)
April 20, 2017 at 7:59 am
dmbaker - Thursday, April 20, 2017 7:54 AMThom A - Tuesday, April 18, 2017 9:38 AMHave you ever heard the proverb "give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime"?Teach a man to build a fire and he'll be warm for a night. Set a man on fire and he'll be warm for the rest of his life.
(sorry, having a cynical day today :Whistling:)
I prefer this version:
Give a man a fish and you feed him for a day; teach a man to fish and he'll drink beer for the day.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
April 20, 2017 at 11:37 am
mw112009 - Tuesday, April 18, 2017 9:19 AMTo All ( Bran,Luis,Jeff,Phil and anyone who comments ... )
You guys are a great help. Sorry I am not able to pay you.Hey, Helping a needy person is a act of Good Will. You may not get paid by me but you will receive a bigger return ( Count on that ).
Why do I say this ? I have complete trust in the Bible.
Also one more point... When helping others do it with love ( Never complain ...only then will you receive a return for your favor )
That is how real "Faith" works ( Galatians 5:6 , The only thing that counts is faith expressing itself through love. ) .Ha Ha... I can see a few of you may be getting pizzed off by my comments... Hey,no hard feelings...but I have 100% faith in what I wrote above.. if it works for me it works for you. It is a UNIVERSAL LAW.. guaranteed to work.. )
Using religious beliefs as an excuse to abuse the privilege of belonging to a forum is as corrupt as the practices you would consider sins, so please don't expect any further assistance from me. You won't get any. Abuse is abuse. Period, end of sentence, end of paragraph, end of assistance. You really should be ashamed of your lazy self. And didn't your Bible also state "God helps those who help themselves" ?
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
April 20, 2017 at 12:37 pm
sgmunson - Thursday, April 20, 2017 11:37 AMAnd didn't your Bible also state "God helps those who help themselves" ?
Err...No.
https://en.wikipedia.org/wiki/God_helps_those_who_help_themselves
Viewing 15 posts - 31 through 44 (of 44 total)
You must be logged in to reply to this topic. Login to reply