473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

create a date

ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes
Nov 19 '05 #1
6 1114
On Fri, 8 Jul 2005 15:45:06 -0700, "Kurt Schroeder"
<Ku***********@discussions.microsoft.com> wrote:
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes


Try d = DateTime.Parse("5/5/2005")

Nov 19 '05 #2
Try:
d = CDate("05/05/2005")

"Kurt Schroeder" wrote:
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes

Nov 19 '05 #3

"Kurt Schroeder" <Ku***********@discussions.microsoft.com> wrote in message
news:44**********************************@microsof t.com...
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes


The others would work, but so does this :)

Dim d As DateTime = New DateTime(2005, 05, 05) ' year, month, day

HTH,
Mythran

Nov 19 '05 #4
you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes

"David" wrote:
Try:
d = CDate("05/05/2005")

"Kurt Schroeder" wrote:
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes

Nov 19 '05 #5
you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes

"Peter D. Dunlap" wrote:
On Fri, 8 Jul 2005 15:45:06 -0700, "Kurt Schroeder"
<Ku***********@discussions.microsoft.com> wrote:
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes


Try d = DateTime.Parse("5/5/2005")

Nov 19 '05 #6
you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes

"Mythran" wrote:

"Kurt Schroeder" <Ku***********@discussions.microsoft.com> wrote in message
news:44**********************************@microsof t.com...
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes


The others would work, but so does this :)

Dim d As DateTime = New DateTime(2005, 05, 05) ' year, month, day

HTH,
Mythran

Nov 19 '05 #7

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

Similar topics

5
by: Ken Fine | last post by:
I want my application to maintain a directory tree based on months and years, e.g.: 2004 January file file file February file
2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
1
by: YONETANI Tomokazu | last post by:
Hello. After upgrading a test database to V8.2 with FixPak7a, too see if the production servers can be safely upgraded, I noticed that inserts on an insertable view which consists of multiple...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
2
by: Alicia | last post by:
Does anyone know why I am getting a "Syntax error in Create Table statement". I am using Microsoft Access SQL View to enter it. Any other problems I may run into? CREATE TABLE weeks (...
9
by: Marc Miller | last post by:
Hi all, I have 2 dev. machines, the 1st is Win 2000 with .NET 7.0 and the 2nd is XP Pro with .NET 2003. My Web Server is Win 2000 Server with IIS 5.0. I can create a new project on my test...
9
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database...
10
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the...
4
by: ringer | last post by:
I have a db where each record is a certain task to be done. Each record includes the date the task should be completed. Some of the tasks are one time only but some are recurring. I have been having...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...

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.