Converting Now() to pure date

  • Thread starter Thread starter Domac
  • Start date Start date
D

Domac

Hi,

What is the best way to convert return value of Now() function to pure Date
(21.062006. 15:30 => 21.06.2006.)??


Thanks!
Domagoj
 
Hi, Domac.
What is the best way to convert return value of Now() function to pure
Date

Instead of converting the value returned from the Now( ) function, you'd use
the Date( ) function in your code. However, if you want to convert a
Date/Time value that has already been stored in the table by using the
Now( ) function, then use the DateValue( ) function. For example:

SELECT IIF(ISNULL(SomeDate), NULL, DateValue(SomeDate)) AS TheDate
FROM tblStuff;

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
I usually use Int(Now). Using Int() truncates the date to just date, no time
stamp.
 
DateValue is preferred to Int (Int doesn't work properly for dates prior to
30 Dec, 1899)
 
converting to an INT will ROUND UP won't it?

converting 1/26/2006 12:40pm to a decimail and you've got 3244.546
this rounds UP.
From what I understand; you need to subtract .5 from a date and then
convert to an int in order to get the correct date.

-Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top