Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Format Date Range in Select Statement e.b. 4/10/14 - 4/09/15

$
0
0

So far thanks for all the help you've provided me on here. I'm a long time Access developer and have just worked with SQL very little throughout the years but now I'm working full-scale in it, so a learning process for me.

I am familiar with the DateADD function in SQL DATEADD(mm, 1, GETDATE())  AS MyDate. The part that I'm struggling with is that I need to show a date range in a single field. I can not do it by having that function twice because of the character"-", which will throw and error. I played around with the "Convert" function some and I am thinking that a combination of the Convert and DateADD functions would be the way to accomplish this but I'm not sure.

Basically what I need is using today's date as an example, I would need the result to return 04/10/14-04/09/15. Any assistance would be appreciated.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>