473,378 Members | 1,507 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,378 software developers and data experts.

How to format a field on a form as date ?

22
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 7862
MMcCarthy
14,534 Expert Mod 8TB
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
Hi,
Thanks for ur advise,

i gave this in my code,
MEMBER_END_DATE1 = 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 Expert Mod 8TB
Hi,
Thanks for ur advise,

i gave this in my code,
MEMBER_END_DATE1 = 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
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...
1
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....
6
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...
0
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",...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format Last Modified date with javascript...
3
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...
0
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...
2
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
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
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
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...

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.