Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
spitfire122
Starting Member
11 Posts |
Posted - 2011-08-04 : 17:23:04
|
I have UDT where I need to pull historical data in a date range from 4/1/11 to 7/31/11.I need to find all loans where it entered into statusB between the date range.declare @startdate smalldatetimedeclare @enddate smalldatetimeset @startdate = '4/1/11'set @enddate = '7/31/11'selectcase when (svstart.delinquency_status_03 = 'modification' or svend.delinquency_status_03 = 'modification') and (ptstart.workout_start between @startdate and @enddate or ptend.workout_start between @startdate and @enddate) then 'New Loans Received for Modification' |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-08-04 : 18:27:13
|
| Did your posting get cut-off halfway through? The query does not have a FROM clause, and no sample data etc. |
 |
|
|
jcelko
Esteemed SQL Purist
547 Posts |
Posted - 2011-08-07 : 12:56:40
|
| Every SQL forum OR newsgroup expects that you will post DDL, sample data and clear specifications which might might include output. This is explained in the FAQ section. We can not read minds; what would we need to know to do your job for you? Tables must have keys and should have DRI, constraints, and all the basic features of a schema. You should know use ISO-8601 Standards for temporal data (you do not know it), avoid needless dialect, basic data modeling and use ISO-11179 Standards for data element names, which you do not know. >> I have UDT where I need to pull historical data in a date range from 2011-04-01 to 2011-07-31. I need to find all loans where it entered into statusB between the date range. <<You did not get the memo; we have a DATE data type in T-SQL. And we use the ISO-8601 date format. Yes, you need that display format not just because it is the only one allowed in ANSI/ISO Standard SQL, but in a few hundred ISO and industry standards. DECLARE @local_start_date DATE;DECLARE @local_end_date DATE;SET @local_start_date = '2011-04-01';SET @local_end_date = '2011-07-31';Where is the rest of the post? --CELKO--Books in Celko Series for Morgan-Kaufmann PublishingAnalytics and OLAP in SQLData and Databases: Concepts in Practice Data, Measurements and Standards in SQLSQL for SmartiesSQL Programming Style SQL Puzzles and Answers Thinking in SetsTrees and Hierarchies in SQL |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|