|
-
Jun 13th, 2004, 02:15 PM
#1
Thread Starter
Addicted Member
Date field[RESOLVED]
Ok i created DB in Access 2003,
now I created some fields and one of them is Date field (Short Date), it shows like this the date: mm/dd/yyyy
the problem i must show it like this
dd/mm/yyyyy
can it be changed?
cheers.
Last edited by ArChAnGeL2k3; Jun 14th, 2004 at 05:06 AM.
-
Jun 13th, 2004, 10:36 PM
#2
Fanatic Member
well, ....
where you need to show it ?
if you need to show it from VB, you can use format functions...
format(yourfield,format syntax)
e.g:
format(yourfield,"dd-mm-yyyy")
-
Jun 14th, 2004, 01:35 AM
#3
Thread Starter
Addicted Member
ok , and if I connected my MSFLEX Grid to Data object (Which has this field), how can i change its format?
thx for the tip.
-
Jun 14th, 2004, 02:49 AM
#4
Fanatic Member
sorry man...
i rarely use MSFLEX...
but here the sample on another type of object
VB Code:
private sub format_date()
dim myRs as New ADODB.Recordset
'assuming myConn is the connection string
'assuming there's Textbox object (name = Text1) at the form
myRs.open "select mydatefield from mytable" _
,myconn,adopenkeyset,adlockoptimistic,adcmdtext
if myrs.recordcount > 0 then
Text1.Text = Format(myRs!mydatefield, "dd-mm-yyyy")
msgbox "Press OK to next record !!!"
myrs.movenext
end if
myrs.close
set myrs = nothing
end sub
well, I believe for another object will be almost the same
-
Jun 14th, 2004, 03:05 AM
#5
Format it in the Sql statement
eg
Code:
select ...... format(datefield,"dd mmm yyyy") as Ddate..... from ....
All dates are just a number past a starting point, so if you store them properly, its just a matter of displaying them how you choose.
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 14th, 2004, 04:36 AM
#6
Fanatic Member
Originally posted by Ecniv
Format it in the Sql statement
eg
Code:
select ...... format(datefield,"dd mmm yyyy") as Ddate..... from ....
are you sure there is format function at SQL ?
I don't think there is.
I try, result :
'format' is not a recognized function name.
-
Jun 14th, 2004, 05:02 AM
#7
Thread Starter
Addicted Member
Originally posted by Ecniv
Format it in the Sql statement
eg
Code:
select ...... format(datefield,"dd mmm yyyy") as Ddate..... from ....
All dates are just a number past a starting point, so if you store them properly, its just a matter of displaying them how you choose.
Vince
thx man , thats what iw as looking, and btw i already did it but i didnt updated to RESOLVED this thread, this function woks great!
but there is one more thing bothering me, in the DDB itself i made the format dd/mm/yyyy so why the hell it didnt showed me it correctly?
You just write in ur select:
sql="SELECT ffield1, field2, field3, FORMAT(field4,'DD/MM/YYYY') FROM tblTable"
thx alot guys!, cheers.
Last edited by ArChAnGeL2k3; Jun 14th, 2004 at 05:06 AM.
-
Jun 14th, 2004, 05:02 AM
#8
Re: Date field[UNRESOLVED]
Originally posted by ArChAnGeL2k3
Ok i created DB in Access 2003,
Format in Sql Statement of Access Sql ... well was there in 97 and 2000 so prolly there in 2003. Its not a standard function of Sql statements, but each db has their own additions... 
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 14th, 2004, 05:07 AM
#9
Originally posted by ArChAnGeL2k3
but there is one more thing bothering me, in the DDB itself i made the format dd/mm/yyyy so why the hell it didnt showed me it correctly?
The ADO connection has defaulted it. Probably. hehe I have no idea really. Might be windoze infecting it and changing it, also sometimes happens.
One of those things 
Glad it works ok 
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|