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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-04-19 : 10:27:31
|
| Mike writes "Here is the basic sql I am trying to implement:select classid, count(*) as [COUNT], dtmready from unit where rmpropid = '123' and classid = 'A1' group by rmpropid, classid, dtmready order by dtmready;Here is my result set:A1 3 2006-07-01 00:00:00.000A1 10 2006-08-15 00:00:00.000A1 11 2006-09-15 00:00:00.000A1 10 2006-10-15 00:00:00.000A1 10 2006-11-01 00:00:00.000A1 10 2006-11-30 00:00:00.000If you notice, the earliest dtmready is 7/1/2006. What I need is the sql to return an additional row when the earliest dtmready is after today. Is this possible? Background: The result of this query is returned to a java program at a level where I do not have the ability to add a new row to the record set, so if I can get the "extra" row back from the sql, I can then manipulte it accordingly. I am using MS SQL Server 2000, SP4" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-19 : 10:31:18
|
| Not sure whether you need thisTrySelect columns,(select min(datecol) from yourtable where datecol>getdate()) as earlier_datefrom yourTableMadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-19 : 10:43:18
|
Can you post how the extra row looks like ? KH |
 |
|
|
|
|
|