473,386 Members | 1,734 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.

string to date conversion..please help..

18
i have this code..i don't know what where is the error in this one..it says data type mismatch.....

Dim Mydate As Date
Dim MydateString As String

MydateString = "Text1.Text"
Mydate = CDate(MydateString) ''it is highlighted in this line..
txtActCode = Mydate

i don't know what's wrong with this one..
any help would be much appreciated..
thank you..
Oct 3 '09 #1
4 2336
debasisdas
8,127 Expert 4TB
CDate Returns Results in System's Short Date Format.

The parameter for cdate is any valid date expression as string.

What are you passing ?
Oct 3 '09 #2
jupi13
18
i have a textbox where i could input a date..example: October 2,2009.
is "October 2,2009" a valid date expression string?
Oct 3 '09 #3
jupi13
18
i got a problem with regards to comparing my date from my textbox from the dates in my database... it says "Data type mismatch in criteria expression"

i got my code here:


txtActCode.Text = Format$(txtDate.Text, "MM/dd/YY")

If rs.State = adStateOpen Then Set rs = Nothing
rs.Open "SELECT * from tblActMeetings where fldActDate='" & txtActCode.Text & "'", cn

the error is right in the underlined line of code...
please help...
would be much appreciated.....
Oct 4 '09 #4
debasisdas
8,127 Expert 4TB
Pass parameters to cdate in any of the following formats

Statement Result
================================
CDate("May 14 1977") ------ 14/05/1977
CDate("14/May/1977") ------ 14/05/1977
CDate("14/05/1977") -------14/05/1977
CDate("05/14/1977") -------14/05/1977
Oct 5 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: praba kar | last post by:
Dear All, I have doubt regarding date string to time conversion function. In Python I cannot find flexible date string conversion function like php strtotime. I try to use following type...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
50
by: z. f. | last post by:
HI, i have string in format dd/mm/yyyyy hh:mm:ss and giving this as an input to DateTime.Parse gives a string was not recognized as a valid date time format string error. how do i make the parse...
1
by: jwf | last post by:
This question continues on from a previous post "DATE to string" but I think it deserves a new thread. In my previous post I was trying to convert a DATE to string in a NON MFC C++ application...
1
by: itfgnanvigneshwari | last post by:
hai, as i am new to php field i had a problem in date field. i have table named student with fields fieldname type name varchar...
5
by: AMP | last post by:
Hello, I want to add some variables to a string and this isnt working. textBox1.Text="'BSL version='+ bslVerHi+ bslVerLo"; What am I doing wrong? Thanks Mike
4
by: Phillip Vong | last post by:
VS2005 in VB.NET I have 2 simple textboxes (Textbox1, Textbox2) and they both have dates. Textbox1=12/31/2006 Textbox2=12/15/2006 I need to convert these two textboxes that are in String...
2
by: Brian Parker | last post by:
I am beginning to work with VB2005.NET and I'm getting some problems with string formatting converting an application from VB6. VB6 code:- sTradeDate = Format(pArray(4,i Record), "mmddyy") ...
0
by: robtyketto | last post by:
Greetings, I'm using MDMZinc to insert/update records into an MSAccess database, many headaches have been caused by dates. Apparently the best method to avoid complication is to record date...
2
by: RN1 | last post by:
A TextBox displays the current date (in dd/mm/yyyy format) & time when a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the date into international format so that the remote server...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.