Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


can I use while loop for only one column?


can I use while loop for only one column?

Author
Message
abhas
abhas
SSC Veteran
SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)

Group: General Forum Members
Points: 278 Visits: 662
Hi All,

Please help me on below scenario.

I am having application where user selects startdate and enddate from his application(front end). but if he selects Startdate is 2013/01/01 and EndDate as 2013/01/31. Then ihave to insert in the database as effetivedate which is calculated column based on startdate and enddate and will display all dates inbetween selected date. so in the above case,i want to insert effectiveDate as
2013/01/01
2013/01/02
.
.
.
.2013/01/31

please help.
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16539 Visits: 16992
abhas (4/12/2013)
Hi All,

Please help me on below scenario.

I am having application where user selects startdate and enddate from his application(front end). but if he selects Startdate is 2013/01/01 and EndDate as 2013/01/31. Then ihave to insert in the database as effetivedate which is calculated column based on startdate and enddate and will display all dates inbetween selected date. so in the above case,i want to insert effectiveDate as
2013/01/01
2013/01/02
.
.
.
.2013/01/31

please help.


You are going to have to give a better explanation than that for us to be able to help. Remember we can't see your screen, we don't know your data structures and we don't know what you are trying to accomplish.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
ChrisM@Work
ChrisM@Work
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 8957 Visits: 19011
abhas (4/12/2013)
Hi All,

Please help me on below scenario.

I am having application where user selects startdate and enddate from his application(front end). but if he selects Startdate is 2013/01/01 and EndDate as 2013/01/31. Then ihave to insert in the database as effetivedate which is calculated column based on startdate and enddate and will display all dates inbetween selected date. so in the above case,i want to insert effectiveDate as
2013/01/01
2013/01/02
.
.
.
.2013/01/31

please help.


Already answered here. Abhas, if you are unsure about any aspect of a solution offered to you, don't be afraid of asking for more information. Folks here will help you.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
abhas
abhas
SSC Veteran
SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)SSC Veteran (278 reputation)

Group: General Forum Members
Points: 278 Visits: 662
Thanks Chris......... Smile
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search