
02/01/2008, 18:18
|
| | Fecha de Ingreso: noviembre-2005
Mensajes: 6
Antigüedad: 19 años, 5 meses Puntos: 0 | |
Fechas con Array Hola a todos, primeramente Feliz año, y pues tengo un problema, tengo el siguiente código
var Facturas = "",i = 0,strSQL="";
var Proyecto = new Array();
var Cliente = new Array();
var Factura = new Array();
var Fechaf = new Array();
var Importe = new Array();
var Accion = new Array();
var Fechag = new Array();
var Collect = new Array();
Proyecto = ListToArray(prm_proyecto);
Cliente = ListToArray(prm_cliente);
Factura = ListToArray(prm_factura);
Importe = ListToArray(prm_importe);
Fechaf = ListToArray(prm_fechaf);
Accion = ListToArray(prm_accion);
Fechag = ListToArray(prm_fechag);
Collect = ListToArray(prm_collect);
var rsFacturas = Server.CreateObject("ADODB.Command");
rsFacturas.ActiveConnection = "dsn=poolmty";
for(i = 0 ; i < Proyecto.length ; i++ ) {
if (ltrim(Factura[i])!=" " && ltrim(Factura[i])!="") {
strSQL = "INSERT INTO Facturas ( Proyecto, NoDocto, NoCuenta, FechaOrigen, FechaRecibida, TipoTrans, Moneda, MontoOriginalMXP, Funcional, PromptAction, PromptDate, PromptCollect, Status) values('" + ltrim(Proyecto[i]) + "','" + ltrim(Factura[i]) + "','" + ltrim(Cliente[i]) + "',#" + ltrim(Fechaf[i]) + "#,#01/01/1900#,'INV','MXN'," + ltrim(Importe[i]) + "," + ltrim(Importe[i]) + ",'" + ltrim(Accion[i]) + "',#" + ltrim(Fechag[i]) + "#,'" + ltrim(Collect[i]) + "','REV')";
rsFacturas.CommandText = strSQL;
rsFacturas.Execute();
Facturas = Facturas + strSQL + "/";
Lo que muestro con rojo es una fecha pero se almacena con el formato M/d/YYYY y yo necesito que sea d/M/YYYY esta hora la toma del server y no puedo mover el formato de hora del server porque afectaría otras cosas que ya estan hechas, entonces mi duda es, como puedo dividir Fechag[i] en dia, mes y año para luego acomodarlas como las necesito, se pueden usar las funciones getdate, getMonth y getfullyear tomando en cuenta que es un array??? si es así cual sería la sintaxis correcta,
Les agradezco mucho porque ya me he quebrado mucho la cabeza y tal vez sea algo simple.
Saludos
Maida |