INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

timestamp error

timestamp error

(OP)
hi,
I'm very happy to find finnaly an active forum about pervasive programation.

I'have an ODBC database Connexion and I try to request on it  with this:           

  queryInsLigne = "INSERT INTO LIGNE (TypeMouvement, PiecePrefixe, PieceNumero, IP, TypeLigne, CodeArt, Libelle, CDate, Quantite, CodeDepot, Commentaire, QteInventaire) VALUES ('" & rsCType.Fields(0) & "','INV','" & numPiece.Text & "','" & ip & "','1','" & code & "','" & designation & "','" & Date & "','" & qtt & "','" & depot.codeDepot & "','inventaire portable','" & qtt & "')"

but I receive an "invalid date, time or timestamp value" error...

I have already read an another thread about this error in this forum but the given solution doesn't work with me.
Someone can help me?

RE: timestamp error

What does the actual SQL statement look like with the values?     I'm going to guess that the "Date" field is not in the format PSQL needs.   

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: timestamp error

(OP)
It looks like that:

INSERT INTO LIGNE (TypeMouvement, PiecePrefixe, PieceNumero, IP, TypeLigne, CodeArt, Libelle, CDate, Quantite, CodeDepot, Commentaire, QteInventaire)
VALUES (' ','INV','9','1','1','DESK','Beautifull Desk','20/05/2008','15','1','inventaire portable','15')

I trye to insert this into table LIGNE where the date format is like this dd/mm/yy
 

RE: timestamp error

The PSQL date format needs to be 'yyyy-mm-dd'.  It also needs to include the single quotes.  So the statement needs to be:
INSERT INTO LIGNE (TypeMouvement, PiecePrefixe, PieceNumero, IP, TypeLigne, CodeArt, Libelle, CDate, Quantite, CodeDepot, Commentaire, QteInventaire)
VALUES (' ','INV','9','1','1','DESK','Beautifull Desk','2008-05-20','15','1','inventaire portable','15')

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: timestamp error

(OP)
Thanks a lot, it works!!!
I insert date with 'yyyy-mm-dd' format
and in my row it's automatically converted in the 'dd/mm/yy'.
once again thanks mirtheil

RE: timestamp error

Glad everything works. Thanks for the star.
 

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close