Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax of date functions... ?

I'm trying to use date format reading data from ms access db.

I Always has errors but not so clear.

The problem is on date function but it seems that field are correct.

Is there syntax mistakes ?

LOAD "Id_Off",

    "Tipo_Off",

    "Anno_Off",

    "Nr_Off",

    "Data_Off",

//     date("Data_Off", 'DD-MM-YYYY') As "Data_Off",

    Month("Data_Off") As "Mese_Off",

    Year("Data_Off") As "Anno_Off",

    Day("Data_Off") As "Giorno_Off",

I'm used to put '_' (underscore) within field names but it seems that QS continue to read them as it was a " " blank space adding "    " around the name of field .

Is it better to use [name_field] as in ms access ??

6 Replies
sunny_talwar

Are you getting error while reloading data or are you just not seeing Month, Year, Day getting calculated?

Not applicable
Author

If I comment that three field I don't have any error....

This is the error but it's very cryptic...

CG_OFFERTE_CLIENTI

ODBC read failed: SQL SELECT "Id_Off", "Tipo_Off", "Anno_Off", "Nr_Off", "Data_Off", "Id_anag_cli_Off", "Rag_Soc_Off", "TotImp_Off", "TotNI_Off", "TotIva_Off", "Totdoc_Off", "Totriga_Off", "CodDiv_Off", "Codart_Off", "Descr_art_Off", "Qta_Off", "Prezzo_Off", "Cod_iva_Off", "Qta_evasa_Off", "Saldato_Off", Codcat, "A_saldo_Off" FROM "D:\EOS\CONTROLLO_GESTIONE\QUERY_DINAMICO"."CG_OFFERTE_CLIENTI"

sasiparupudi1
Master III
Master III

Try

LOAD Id_Off,

    Tipo_Off,

    Anno_Off,

    Nr_Off,

    Data_Off,

   date(Data_Off, 'DD-MM-YYYY') As Data_Off,

    Month(Data_Off) As Mese_Off,

    Year(Data_Off) As Anno_Off,

    Day(Data_Off) As Giorno_Off

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Why is there a path name in your MS-Access table specification?

In addition to that, you seem to experience two problems at the same time: one in the ODBC read, and one in the LOAD as you mentioned in the original post?

Not applicable
Author

you get an error if you run it

you cant define 2 fields in the same name

"

Data_Off,

   date(Data_Off, 'DD-MM-YYYY') As Data_Off,

"

Not applicable
Author

Yes , the problem was that but error was really not helpful.

I discover it under ms access trying to simulate the same data query.

[CLOSED]