473,503 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Removing time from date

Hi all

i'm trying to compare a variable containing a date with todays date.

if tempdate <= now()then

trouble is...

tempdate = 05/12/2003
now() = 11/09/2003 14:04:06

how can I get today's date without the time pls

many thanks
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 02/09/2003
Jul 19 '05 #1
2 3956
Instead of Now() can't you use Date()

Gram
"xool" <me@memail.net> wrote in message
news:OO*************@TK2MSFTNGP12.phx.gbl...
Hi all

i'm trying to compare a variable containing a date with todays date.

if tempdate <= now()then

trouble is...

tempdate = 05/12/2003
now() = 11/09/2003 14:04:06

how can I get today's date without the time pls

many thanks
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 02/09/2003

Jul 19 '05 #2
Date :]

Example:

<%

Response.Write "Now returns " & Now & "<br>"
Response.Write "Date returns " & Date & "<br>"
Response.Write "Time returns " & Time

%>

You should use DateDiff for date comparisons like this anyway. Using
DateDiff, it wouldn't matter if the time is in one of your dates if you're
comparing by calendar dates.
http://msdn.microsoft.com/library/en...ctdatediff.asp

Ray at work

"xool" <me@memail.net> wrote in message
news:OO*************@TK2MSFTNGP12.phx.gbl...
Hi all

i'm trying to compare a variable containing a date with todays date.

if tempdate <= now()then

trouble is...

tempdate = 05/12/2003
now() = 11/09/2003 14:04:06

how can I get today's date without the time pls

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1931
by: John McGinty | last post by:
Hello Chaps, Just a little sounding on removing out of hours from some datetime date that I have. Basically we have a helpdesk that logs calls when they are entered and when they are resolved....
4
3271
by: wes | last post by:
I just installed VS .Net 2003 and now when I try to remove something from the GAC I get the error: Unable to uninstall: assembly is required by one or more applications Pending references:...
6
1943
by: christopher.secord | last post by:
I have a table containing typed log entries. One log entry is supposed to be created every twelve hours, but sometimes there are gaps. I need to create a report showing the time of entry, and the...
16
2012
by: graham.reeds | last post by:
I am updating a website that uses a countdown script embedded on the page. When the page is served the var's are set to how long the countdown has left in minutes and seconds, but the rest of the...
1
2237
by: Serge Poirier | last post by:
Good Day Folks, I'm displaying a date field from an Oracle table in a datagrid with the following template. <ItemTemplate> <asp:Label id="hiredate" runat="server" Text='<%# DataBinder.Eval...
8
4424
by: Ryan | last post by:
Hello, I'm new to Access and DB's in general. I've taken over some light duty support for a lab information system we use in house. Most of our dates are reported as "10/31/2006 12:30:00 PM"...
0
1202
by: =?Utf-8?B?RyBIdXN0aXM=?= | last post by:
I am binding a date/time value from an Access database thru a datatable/dataview to a label on a VB2005 form, it's bound like this: lblDOB_CH.DataBindings.Add("Text", dvMembers_CH, "DOB") I want...
2
10659
by: =?Utf-8?B?UHVyZSBIZWFydA==?= | last post by:
i use the following code to display date and time of system System.DateTime.Today.Now but it displayes seconds also haw can i make it display date and time without seconds and haw can it...
4
1616
by: Matt.Russett | last post by:
Hello, Here is what I am trying to do. I am running a report that brings back Requested Pick-Up Times and Actual Pick-Up Times. What I want to measure is the amount of times the Requested...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.