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.
Printable View
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.
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")
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.
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 :)
Format it in the Sql statement
eg
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.Code:select ...... format(datefield,"dd mmm yyyy") as Ddate..... from ....
Vince
are you sure there is format function at SQL ?Quote:
Originally posted by Ecniv
Format it in the Sql statement
eg
Code:select ...... format(datefield,"dd mmm yyyy") as Ddate..... from ....
I don't think there is.
I try, result :
'format' is not a recognized function name.
Quote:
Originally posted by Ecniv
Format it in the Sql statement
eg
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.Code:select ...... format(datefield,"dd mmm yyyy") as Ddate..... from ....
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.
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... :)Quote:
Originally posted by ArChAnGeL2k3
Ok i created DB in Access 2003,
Vince
The ADO connection has defaulted it. Probably. hehe I have no idea really. Might be windoze infecting it and changing it, also sometimes happens.Quote:
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?
One of those things ;)
Glad it works ok :)
Vince