Thanks guys - it works fine.
BTW - we don't usually need both the date and time. Most of the time we want
> A Datetime datatype is exactly that, a Date and the Time. Even though you
> may have entered only the Date portion or your GUI only displays the Date
> portion it always has a Time portion as well. By default if you only
> the date it will add Midnight (00:00:00) to what ever the date is. If you
> always need both the date and time (even if just the hour is relavant)
> there is no need for 2 different columns as the Datetime will hold both
> values. If you look in BooksOnline under functions you will see several
> that allow you to manipulate or return values from a DateTime datatype.
> your case if all your dateTime values have Midnight for the time portions
> you can add the hour to it similar to this:
> SELECT DATEADD(hh,HourField,DateField) FROM YourTable
> Andrew J. Kelly, SQL Server MVP
> > I have 1 field which is a datetime and another which is a hour. I want
> > put the 2 together to for a datetime.
> > In Oracle I do:
> > select datefield + hourfield/24 from mytable
> > which returns
> > 5/16/2002 1:00:00AM
> > given that datefield = 5/16/2002 and hourfield = 1
> > how can I do this in SQLServer 2k plus format it to return as formatted
> > above?
> > Thanks.