473,652 Members | 3,039 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 3962
Instead of Now() can't you use Date()

Gram
"xool" <me@memail.ne t> wrote in message
news:OO******** *****@TK2MSFTNG P12.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.ne t> wrote in message
news:OO******** *****@TK2MSFTNG P12.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
1948
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. Now, if this happens during the day we just subtract one date from the other to give the time it took to resolve the issue. If it is not solved during the day we have an additional 11 hours to add due to people going home and not worrying about...
4
3280
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: SCHEME: <WINDOWS_INSTALLER> ID: <MSI> DESCRIPTION : <Windows Installer> These are components I had no problems installing and
6
1950
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 actual log entry. I can't just list the contents of the log table, because if I do that there will be dates missing. Instead, when there isn't a log entry for a date, I need to print the date, and then just leave the log entry blank. The SQL...
16
2038
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 script is left untouched. However I want to take the script out of the page and have it as a seperate file that can be cached, reducing serving costs - the page gets hit a couple of thousand times per day, sometimes as high a 5K, so any...
1
2245
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 (Container.DataItem,"hiredate","{0:d}") %>'> </asp:Label>
8
4425
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" (With seconds listed in the report field). However, nobody wants to see the seconds. So I tried to format it =Format(DateCollected, "mm/dd/yy hh:nn AM/PM"). Works great, right? Well.. yeah for the most part. However if we
0
1210
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 to display the date only part of the data in mm/dd/yyyy format. I cannot seem to find a way to format the contents of the label to be only the date. It shows like this: mm/dd/yyyy 12:00:00 AM. Does any one know of a way to strip off the time from...
2
10677
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 display time only with no date and without seconds also thank you --
4
1624
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 and Actual fall on the same DATE. I don't care about the time. I created a formula that says "If Requested = Actual , Then 1, Else 0" The idea is that I can sum all the 1's and compare to the total number of shipments, and determine the On-time %.
0
8367
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8703
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
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 we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.