format two field date and time and format the combination as long date

  • AdmDtAdmTm

    2010-11-2212:52

    2010-12-0613:03

    2010-12-0912:22

    I have table with admDt and admTm. I want to combine those two field together and format the new field as long date so that I can find out the date difference with other field. Thanks.

  • in ms access I found this way:

    DateAdd("d",0,DateDiff("d",0,[AdmDt]))+DateAdd("d",0-DateDiff("d",0,[AdmTm]),[AdmTm])

    Thx.

  • SELECT Convert(datetime,CONVERT(varchar(20),AdmDt)+ ' ' +CONVERT(varchar(5),AdmTm))

    SELECT DATEADD(d,datediff(day,convert(datetime,admtm),admdt ,convert(datetime,admtm) )

    Jim

  • In MS Access, do not have the function convert. Thx.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply