473,473 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Urgent : DateTime format in MySQL

bhv
hello everybody, i have datetime format in mysql database table. now,
in mysql date is YYYY-MM-DD format. how can i insert date in this
format with VB Script ? i had tried following

dim dt, dy, dm, dd, pd, tm
tm = Time
dt = Date
dy = DatePart("YYYY",dt)
dm = DatePart("M",dt)
dd = DatePart("D", dt)

pd = dy & "-" & dm & "-" & dd & " " tm

this shows correct datetime, but doesn't insert in database table. it
gives error: incorrect format.

this is my first project in MySQl. please help

thanks

Bhagvati

Sep 11 '06 #1
2 8920

bhv wrote:
hello everybody, i have datetime format in mysql database table. now,
in mysql date is YYYY-MM-DD format. how can i insert date in this
format with VB Script ? i had tried following

dim dt, dy, dm, dd, pd, tm
tm = Time
dt = Date
dy = DatePart("YYYY",dt)
dm = DatePart("M",dt)
dd = DatePart("D", dt)

pd = dy & "-" & dm & "-" & dd & " " tm

this shows correct datetime, but doesn't insert in database table. it
gives error: incorrect format.

this is my first project in MySQl. please help

thanks

Bhagvati
Writing "Urgent" in the subject really won't help your chances of a
speedy response!

Good luck

Sep 11 '06 #2
bhv
well, i have done it.

Bhagvati

strawberry wrote:
bhv wrote:
hello everybody, i have datetime format in mysql database table. now,
in mysql date is YYYY-MM-DD format. how can i insert date in this
format with VB Script ? i had tried following

dim dt, dy, dm, dd, pd, tm
tm = Time
dt = Date
dy = DatePart("YYYY",dt)
dm = DatePart("M",dt)
dd = DatePart("D", dt)

pd = dy & "-" & dm & "-" & dd & " " tm

this shows correct datetime, but doesn't insert in database table. it
gives error: incorrect format.

this is my first project in MySQl. please help

thanks

Bhagvati

Writing "Urgent" in the subject really won't help your chances of a
speedy response!

Good luck
Sep 13 '06 #3

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

Similar topics

7
by: Tony Clarke | last post by:
Hi, Is there an easy way of formatting a MySQL DATETIME field in PHP. At the moment I'm using the code below, as using the returned DATETIME value from the database with the date() function...
4
by: ramarnath | last post by:
Problem in sending datatime format to the .net webservice from php. description follows. I've created a .net webservice. ..Net Webservice: <WebMethod()> _ Public Function HelloDate(ByVal...
5
by: Vishal | last post by:
Hey, I have differnt kind of dates. They can be in this format: Thur, 23 Sept 2004 14:24:15 GMT Thur, 23 Sept 2004 14:24:15 PST Thur, 23 Sept 2004 14:24:15 CST and so on....
9
by: Shapper | last post by:
Hello, I created a dataset from a XML file. One of the dataset fields is . In an ASP:Repeater I am displaying the field. <%# DataBinder.Eval(Container.DataItem, "pubDate", "{0:f}") %> The...
0
by: rlaemmler | last post by:
Hi, I just migrated my web app to .NET 2.0. Part of the app creates some business objects from a MySQL query which is returned by a web service. Some of those objects contain DateTime...
6
by: Brandon | last post by:
I'm using PHP with MySQL 4.x and was having trouble converting a datetime from MySQL into a formatted string until I ran across this solution that converts a YYYY-MM-DD HH:MM:SS string into a...
5
by: rouven | last post by:
Hi, i am trying to convert that time format '05:26:40 Jun 19, 2007 PDT' into mysql compatible format like YYYY-MM-DD HH:MM:SS. the code i tried was: from datetime import datetime from time...
2
by: smitanaik | last post by:
hi i want to do validation of datetime in javascripti.e is i want it in this format dd:mm:yyyy:hh:mm:ss plz heklp me out its urgent
2
by: electronik | last post by:
I dont really have a problem, but I want to make my code faster and prettier. I have some tables with DATETIME in it. They have the std format %Y-%m-%d %H:%i:%s I need them to be in %d.%m.%Y %H:%i...
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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
1
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
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...
0
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 ...
0
muto222
php
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.