Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 13th, 2005, 09:49 PM
phbenne phbenne is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 1 phbenne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 24 sec
Reputation Power: 0
Question max date from a group of records

Hello all,
I am trying to select (and then insert into a table) the following:

select policy_number,max(policy_date_time) as maxdate,policy_form,county,protection_class,constr uction_type,occupancy,
amt_of_ins,liab_amt,med_pay_amt,ded_amt,rc_acv_bld g,rc_acv_contents,protective_device,
primary_loc

from fact_policy_ap
group by policy_number
having max(policy_date_time)

-- and of course, it does not work. What I have is a group of many records per policy_number that I need to just "grab" the record with the maximum policy_date_time..??? Any help\suggestions are appreciated.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > max date from a group of records


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT