473,748 Members | 6,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing date format in update statement

jt
I posted this yesterday, but I am not seeing this out yet:

I am having problems with updating a date field in a certain format.
The data is stored in an Oracle database. The date is automatically
displayed in format, "mm/dd/yyyy" on the ASP page, but it is accepted
only in another format, "dd/mon/yy". I want to make it consistent.
How can I force it to accept the date in format "mm/dd/yyyy"? The
second option would be to force it to display in "dd/mon/yy". Here's
my current update SQL statement:

commUpdate.Comm andText = "UPDATE table1 SET DatePaid = '" +
varDatePaid +
"' WHERE ID = " + varRecID

thanks,
jt
Jul 19 '05 #1
1 60930
Oracle stores date in generalized format, you can display in many
different formats . For that you can use to_char sql function.
like

to_char(Date_in _database, 'MM-DD-YYYY HH24:MI:SS');

Similarly you convert the Date in character format to Date format
using to Date function
To_date('12-12-1999','MM-dd-YYYY');

in your case trying to update the date field in oracle you could try
some thing like this
update table1 set datepaid = to_date('12/12/1999','MM/DD/YYYY')

Since ASP variables display date in character format and their
data-type is character so you need to convert it to date datatype
using to_date function.

Hope it helps!

Faheem
ju**********@ya hoo.com (jt) wrote in message news:<6f******* *************** ****@posting.go ogle.com>...
I posted this yesterday, but I am not seeing this out yet:

I am having problems with updating a date field in a certain format.
The data is stored in an Oracle database. The date is automatically
displayed in format, "mm/dd/yyyy" on the ASP page, but it is accepted
only in another format, "dd/mon/yy". I want to make it consistent.
How can I force it to accept the date in format "mm/dd/yyyy"? The
second option would be to force it to display in "dd/mon/yy". Here's
my current update SQL statement:

commUpdate.Comm andText = "UPDATE table1 SET DatePaid = '" +
varDatePaid +
"' WHERE ID = " + varRecID

thanks,
jt

Jul 19 '05 #2

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

Similar topics

5
5137
by: S.Patten | last post by:
Hi, I have a problem with updating a datetime column, When I try to change the Column from VB I get "Incorrect syntax near '942'" returned from '942' is the unique key column value However if I update any other column the syntax is fine
2
6149
by: Chris | last post by:
Hello, i'm using a form with 2 dates in the format mm/dd/yyyy in it. I wanna calculate the days between the two dates. I tried it like this: <script language="JavaScript"> var date1 = new date("10/22/2003"); var date2 = new date("10/25/2003"); var diff = date2.gettime() - date1.gettime();
1
357
by: Gani Pola | last post by:
Can someone please tell me how I can change the date format (e.g dd/mm/yyyy, mm/dd/yyyy) in a configuration file? In my windows app, I can retrieve the windows setting but not my ASP.NET application. TIA GP
5
1637
by: Terry Olsen | last post by:
I have a function that returns the date in the following format: 6/22/2005 I need the format to be: 050622 I have zero experience with RegEx but I believe that would be the way to go here. Can someone give me some info on this? Or if RegEx isn't the way,
8
2604
by: frenzic | last post by:
Hi I am a DBA - just been in the job two weeks and I would be grateful for some help. I am trying to update a table with values from another table. I have spent two days on this and I think I may have blown a fuse in my brain! The 'from' table has 3 rows in it and the 'to' table has 3094.
5
4217
mgpsivan
by: mgpsivan | last post by:
Hi, i have form in Asp.net(2003) in that i've to change the format of the date by the following statement Format(Date.Today, "dd/mm/yyyy") but when i give this code the month part displays as 00 i.e i get the output as the folowing for eg: "18/00/2007" can any one help me in changing the format... Thanks in Advance..... Sivan.G.....
15
4635
by: cephal0n | last post by:
I have a technical Date problem that's really difficult for me, I have a "custom made" Date format MM.DD.YY this is actually extracted from SAP and theirs no other format option offered such as ShortDate, LongDate etc. so now I making a sql query that must convert SAP date to a date Format that is recognizable to MS Access and I choose the ShortDate MM/DD/YY using ADO. I read about the Format() command using ADO online and experiment on it and...
1
439
by: jt | last post by:
I posted this yesterday, but I am not seeing this out yet: I am having problems with updating a date field in a certain format. The data is stored in an Oracle database. The date is automatically displayed in format, "mm/dd/yyyy" on the ASP page, but it is accepted only in another format, "dd/mon/yy". I want to make it consistent. How can I force it to accept the date in format "mm/dd/yyyy"? The second option would be to force it to...
2
1828
by: deathal | last post by:
Hi I'm trying to make a list of dates between two dates and i found this http://bytes.com/forum/thread774887.html and used the code at the bottom to make the list but i need the list to output in mm/dd/yy format instead of yyyy-mm-dd, and i was wondering if there is a line or two of code i could add to have it do that for me. I'm pretty new to python so if this is a stupid question with a really easy answer sorry for wasting peoples...
0
9370
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
9247
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
8242
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...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
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
4602
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
3312
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
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.