Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

can I use while loop for only one column? Expand / Collapse
Author
Message
Posted Friday, April 12, 2013 1:45 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 4:23 AM
Points: 224, Visits: 560
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.
Post #1441596
Posted Friday, April 12, 2013 7:45 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 11:50 AM
Points: 13,082, Visits: 12,547
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)
Post #1441699
Posted Friday, April 12, 2013 7:52 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:08 AM
Points: 6,791, Visits: 14,002
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
Post #1441707
Posted Monday, April 15, 2013 5:26 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 4:23 AM
Points: 224, Visits: 560
Thanks Chris......... :)
Post #1442259
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse