473,785 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to format a field on a form as date ?

22 New Member
I am using ODBC with oracle tables..

My table has columns startdate and end date which are of type varchar(backend tables)..but when i display it in form it should display it as mm/dd/yyyy format, i tried setting format property as Short date but that doesnt work as my form is based on a query.and all the more my table stores the date as yyyymmdd -19990110, this is the way its stored in table (in varchar) so how do i do this?

i also tried "to_date(substr (startdate,5,4) ,'mmdd')" --putting this in the query based on which the form loads but this doesnt work even..
i cannot run this query from access as it says undefined function to_date , but when i run this in Sqlplus it gives me the output but i m not able to get the year part...

So how do get the date field in form as mm/dd/yyyy?

Thanks very much in advance!!!
Mar 15 '07 #1
3 7897
MMcCarthy
14,534 Recognized Expert Moderator MVP
I am using ODBC with oracle tables..

My table has columns startdate and end date which are of type varchar(backend tables)..but when i display it in form it should display it as mm/dd/yyyy format, i tried setting format property as Short date but that doesnt work as my form is based on a query.and all the more my table stores the date as yyyymmdd -19990110, this is the way its stored in table (in varchar) so how do i do this?

i also tried "to_date(substr (startdate,5,4) ,'mmdd')" --putting this in the query based on which the form loads but this doesnt work even..
i cannot run this query from access as it says undefined function to_date , but when i run this in Sqlplus it gives me the output but i m not able to get the year part...

So how do get the date field in form as mm/dd/yyyy?

Thanks very much in advance!!!
In Access the SQL would be

Expand|Select|Wrap|Line Numbers
  1. Format([startdate],"mm/dd/yyyy")
Mary
Mar 17 '07 #2
jaishu
22 New Member
Hi,
Thanks for ur advise,

i gave this in my code,
MEMBER_END_DATE 1 = Format([MEMBER_END_DATE], "mm/dd/yyyy")

but it gives me this error:
Run time error 6: Overflow..

Member_end_date has value 19960101 ,but i get this error how to get around this, pls help!
Mar 19 '07 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi,
Thanks for ur advise,

i gave this in my code,
MEMBER_END_DATE 1 = Format([MEMBER_END_DATE], "mm/dd/yyyy")

but it gives me this error:
Run time error 6: Overflow..

Member_end_date has value 19960101 ,but i get this error how to get around this, pls help!
Try this ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. MEMBER_END_DATE1 = Format(CDate([MEMBER_END_DATE]), "mm/dd/yyyy")
  3.  
Mar 20 '07 #4

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

Similar topics

36
11328
by: Martin Herrman | last post by:
Dear scripters, I am working on a HTML form in which a date must be entered of the form 'dd-mm-yyyy'. Now I'm looking for a script that, when the user switches to another form field, changes e.g. 'ddmmyyyy' or 'dd-m-yy' to 'dd-mm-yyyy'. I have searched the net using google, but only found validators that show an error if an incorrect format is used. (and I can't write one on my own) Does someone has such a script for me?
1
1328
by: Rafi Kfir | last post by:
HI, 1) I'm using a program that save data automatically into a database. I'm using access to view the data using queries. In the 'StartDate' field the data appears as a number (e.g. 38299.6143981482). What can I do in order to view this data as TIME/DATE? 2) In another field that data is in seconds. How can I format it to show HH:MM:SS ?
6
8365
by: fonzie | last post by:
Is there any way to include two unbound text boxes (for a start date and end date) to a filter-by-form? The users may want to filter by several different fields and they may want to include a date range search on the one date field. Instead of having the users type in
0
1850
by: shakir | last post by:
HI Folks, I am trying to update a text field coulmn in a table with date data. The script is as follows: gp.calculatefield_management("ch_er_primary.shp", "FINAL_CDT", "FORMAT(,""mm/dd/yyyy"")") here the final_cdt : is string field and final_acti is date field.
1
2391
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format Last Modified date with javascript ----------------------------------------------------------------------- Apparently, « new Date() » reads it correctly, though problems can occur if the browser returns only two digits for the year. In particular, time zone, field order and separators may vary. It is also reliant on the server's clock...
3
2522
by: twin_mother | last post by:
I am trying to display my verified_datetime field into 2 different columns (1 for Date, and 1 for Time). Using this query returns nothing. Format (, "mm/dd/yy") AND Format (, "hh:mm") I then would like to filter anything between the hours of 5:00 PM and 8:00 AM but am hitting a roadblock there as well. Any help would be greatly appreciated.
0
1582
by: Kyote | last post by:
In my project I have an underlying Access DB. One of the column's is currently set as a text field but I need to change it to a date/time field. I can open the Access DB in MS Access and change this in Design mode and then set the format to 'Short Date' and then open the appropriate table and it has converted all rows from: 1-5-95 5-13-95
2
2584
by: tahseenm | last post by:
I would like to know the easy way to make my date field to pop up calendar to select my dates in a form date field. Thanks and let me know soon.
4
2336
by: kadavu | last post by:
Table has a date field formatted as a short date dd/mm/yy, and a time field formatted as short time hh:nn. When I join those fields in a query ie. Date_Time:&"_"& the result is displayed as dd/mm/yyyy_hh:nn:ss in the query and the chart that is attached to it. I only want dd/mm/yy_hh:nn to be displayed. How can i change it. I have tried to format the joined field, and either and the query does not run or it makes no difference to the output....
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10151
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
9950
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
8973
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
7499
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
6740
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
5381
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
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.