APPEND FROM SDF DATE FIELDS

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
gcarrizo
Posts: 36
Joined: Fri Oct 07, 2016 1:20 pm
Has thanked: 24 times
Been thanked: 1 time

APPEND FROM SDF DATE FIELDS

Post by gcarrizo » Fri Aug 17, 2018 12:40 pm

8-)

Well I try import from .txt file delimited

with record line's' like this.

36|787|MARZO '17|S|202|LOPEZ R.|2207,68|0,00|0|20/03/2017|01|010036

All fields are imported ok, except date field , that appears in blank.

wrong programmer issue ?

Best Regards

in VFox working good ... lol

-----------------------------------

Bueno, intento importar de un archivo .txt delimitado

con una línea de registro como esta.

36 | 787 | MARZO '17 | S | 202 | LOPEZ R. | 2207,68 | 0,00 | 0 | 20/03/2017 | 01 | 010036

Todos los campos se importan bien, excepto el campo de fecha, que aparece en blanco.

problema de programador equivocado???

Saludos a Todos

en VFox funciona bien ... jajaja

EduardoLuis
Posts: 578
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina
Has thanked: 1 time
Been thanked: 37 times

Post by EduardoLuis » Fri Aug 17, 2018 12:57 pm

Hola Gcarrizo:

Yo tenia escrita una rutina; dame tiempo para buscarla y te la paso.-
Abrazo
Eduardo

Hi Gcarrizo:

I've wrote a routine; give some time to look for it and i upload.-
With regards.
Eduardo

User avatar
gcarrizo
Posts: 36
Joined: Fri Oct 07, 2016 1:20 pm
Has thanked: 24 times
Been thanked: 1 time

Post by gcarrizo » Fri Aug 17, 2018 1:04 pm

Thanks a lot !!!
A greateful help...
Best Regards.
--------------------------------
Muchas Gracias.
Una gran ayuda.
Saludos ...

:D
==================================
EduardoLuis wrote:
Fri Aug 17, 2018 12:57 pm
Hola Gcarrizo:

Yo tenia escrita una rutina; dame tiempo para buscarla y te la paso.-
Abrazo
Eduardo

Hi Gcarrizo:

I've wrote a routine; give some time to look for it and i upload.-
With regards.
Eduardo

User avatar
CalScot
Posts: 251
Joined: Thu Mar 21, 2013 12:22 am
Location: California
Been thanked: 1 time

Post by CalScot » Sat Aug 18, 2018 2:01 am

Just a thought, but as your date in the file to be imported shows as 20/03/2017, is it possible that your system is set to (or defaulting to) using an American style date (which would be 03/20/2017), so your import is rejecting it because there's no month 20 ?

User avatar
PeteWG
Posts: 123
Joined: Sun Mar 21, 2010 5:45 pm
Has thanked: 4 times
Been thanked: 34 times

Post by PeteWG » Sat Aug 18, 2018 10:01 am

gcarrizo wrote:
Fri Aug 17, 2018 12:40 pm
...
wrong programmer issue ?
Not exactly.
(unles the programmer is the creator of .txt file, in which case, yes! it's his fault.. ;) )

In fact, it's the date format that is wrong.
it should drafted to match this format: yyyymmdd to work.
so the 20/03/2017 should be 20170320

hint: in order to achieve such a date format, you must export date values using DtoS( dDate ).

regards,
Pete

User avatar
Anand
Posts: 302
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 58 times
Been thanked: 42 times

Post by Anand » Mon Aug 20, 2018 10:08 am

I make many import from csv programs, to import csv data to our main accounting and inventory application. Many times the data consist of sale or purchases done by different system and database. So the csv files comes with different type of date formats.
We just confirm the format of date in the csv to import and adjust our code accordingly.

Regards,

Anand
Image

User avatar
gcarrizo
Posts: 36
Joined: Fri Oct 07, 2016 1:20 pm
Has thanked: 24 times
Been thanked: 1 time

Post by gcarrizo » Tue Aug 21, 2018 11:31 am

8-)

well.. good point ... after read this I try setting century on, set date british and set date FORMAT "dd/mm/yyyy" but not response as I would like.
Thanks & Best Regards.

----------------------
bien ... buen punto ... despues de leido trate usando century on, set date british y set date FORMAT "dd/mm/yyyy" pero no responde como me gustaría.

Gracias y Saludos

CalScot wrote:
Sat Aug 18, 2018 2:01 am
Just a thought, but as your date in the file to be imported shows as 20/03/2017, is it possible that your system is set to (or defaulting to) using an American style date (which would be 03/20/2017), so your import is rejecting it because there's no month 20 ?

User avatar
gcarrizo
Posts: 36
Joined: Fri Oct 07, 2016 1:20 pm
Has thanked: 24 times
Been thanked: 1 time

Post by gcarrizo » Tue Aug 21, 2018 11:59 am

I try with your advice but result the same :( however, think like Anand.
Thanks for you support.
Best Regards
Anand wrote:
Mon Aug 20, 2018 10:08 am
... So the csv files comes with different type of date formats.
We just confirm the format of date in the csv to import and adjust our code accordingly.
Regards,

Anand

--------------------------------

Trate usando tu consejo pero el resultado es el mismo :( sin embargo pienso como Anand.
Gracias por tu ayuda.
Saludos

"... se reciben distintos archivos del tipo CVS con diferentes formatos de Fecha lo que hacemos es confirmar el tipo de formato para la fecha que usa en el CVS y ajustamos nuestro codigo acorde a ello "

PeteWG wrote:
Sat Aug 18, 2018 10:01 am
gcarrizo wrote:
Fri Aug 17, 2018 12:40 pm
...
wrong programmer issue ?
Not exactly.
(unles the programmer is the creator of .txt file, in which case, yes! it's his fault.. ;) )

In fact, it's the date format that is wrong.
it should drafted to match this format: yyyymmdd to work.
so the 20/03/2017 should be 20170320

hint: in order to achieve such a date format, you must export date values using DtoS( dDate ).

regards,
Pete

Post Reply