Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

helpo, sql statement need

Status
Not open for further replies.

shaygan

Programmer
Feb 19, 2005
12
DE
I know that this forum is not a
asp forum but i a'm desponded and
try it with access specialists!

I have an access table (make with access xp) ,
which has a colum name “datecolum”
in the access format like this : 12.12.2001 12:21:22
(date and hour)
First i read this :

Sql_s= Select datacolum from Customer
rs.open Sql_s, con
……………….
After that save the result to Sql_s:
Set d= rs.Fields („datecolum“)
Response.Write ( FormatDateTime(d,ShortDateTime )
Output is:
Output : 12.12.2001
..........
11.11.2001
??
Response.Write ( d )
get the same result!!
Response.Write ( FormatDateTime(d,0 )
also get the same result!!
What shall I do to get :12.12.2001 12:21:22
maybe there is a special Sql statement
to read this microsoft access XP date fromat!!!!!!????
??
I'm gratefull for your help
 
Is your field [datecolum] actually a date/time data type or is it text? Do you actually want to display [blue]12.12.2001 12.21.22[/blue]?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
And this ?
Response.Write FormatDateTime(rs.Fields("datecolum"), 0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
thanks for your hints
1)this is a date/time type and
i want to display 12.12.2001 12.21.22
after that i want to add all hour,
minuts and secounds together.
>And this ?
>Response.Write FormatDateTime(rs.Fields("datecolum"), 0)

this get the same result: 12.12.2001
(only date )

??
 
Why don't you search google on "FormatDateTime(". I don't program ASP but in the first couple urls, I found some information that would be of help to you.

BTW: this isn't an appropriate question for this forum.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
You may consider writing your own formatting function:
Function myDateTime(dt)
myDateTime=Right("00" & Day(dt),2) _
& "." & Right("00" & Month(dt),2) _
& "." & Year(dt) _
& " " & Right("00" & Hour(dt),2) _
& "." & Right("00" & Minute(dt),2) _
& "." & Right("00" & Second(dt),2)
End Function

And then:
Response.Write myDateTime(rs.Fields("datecolum"))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top