Hello Again.
I have a problem pulling data from a database... I have the table 'regent' and a field fecha that has 'dd/mm/yyyy' format (I guess). when I try to make a query from this table, the Date (fecha) come in 'mm/dd/yyyy' format. Here is short explanation of my page. I tried to use Session.LCID.
Is there a way to Format the Date from SQL sentence, or conn.open?
Follow the dark side, so you can reach the light. [/color}
I have a problem pulling data from a database... I have the table 'regent' and a field fecha that has 'dd/mm/yyyy' format (I guess). when I try to make a query from this table, the Date (fecha) come in 'mm/dd/yyyy' format. Here is short explanation of my page. I tried to use Session.LCID.
Code:
<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252" %>
<% Session.LCID = 2058 %>
<% fecha_Ini = Request.form("ex4")
fecha_fin = Request.Form("ex5")
f_ini = formatdatetime (cdate(fecha_ini),2) 'dd/mm/yyyy format
f_fin = formatdatetime (cdate(fecha_fin),2)
set conn=Server.CreateObject("ADODB.Connection")
constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\[URL unfurl="true"]wwwroot\rpersonal1\personal.mdb"[/URL] & ";Persist Security Info=False"
conn.Open constr
Response.Write "LCID DB: " & conn.Properties("Locale Identifier") & " LCID Page: " & session.LCID
'LCID from DB is 1034 session is 2058
set rs_f=Server.CreateObject("ADODB.recordset")
sqltxt_f = "SELECT regent.fecha as fec "_
& "FROM regent RIGHT JOIN d_gen ON regent.cod = d_gen.cod "_
& "GROUP BY regent.fecha "_
& "HAVING (((regent.fecha) between #" & f_ini & "# And #" & f_fin & "#))"
Response.Write sqltxt_f & "<br>"
rs_f.Open sqltxt_f, conn,1,2
'Here, takes i.e. f_ini=05/05/2003 (May 5,2003)
'f_fin=08/05/2003 (May 8, 2003)....
'And It takes: May 5, 2003 and Aug 5, 2003
Is there a way to Format the Date from SQL sentence, or conn.open?
Follow the dark side, so you can reach the light. [/color}