Hello,
I was developping with SQL Server and now I'm testing with MSDE.
I meet a problem with SQL containing dates. My SQL is :
INSERT INTO PIPT_Campaigns(CAM_CampaignId, CAM_CampaignCode,
CAM_CampaignLabel, CAM_CampaignStartDate, CAM_CampaignEndDate,
CAM_CampaignStatus) VALUES (5, 'C0405', 'Campagne 2004-2005', '01/08/2004',
'28/02/2005', 0)
Is there anything wrong with the date format ? The corresponding columns are
defined as datetime.
Thanks for any answer.
Ouaf wrote:
> Hello,
> I was developping with SQL Server and now I'm testing with MSDE.
> I meet a problem with SQL containing dates. My SQL is :
> INSERT INTO PIPT_Campaigns(CAM_CampaignId, CAM_CampaignCode,
> CAM_CampaignLabel, CAM_CampaignStartDate, CAM_CampaignEndDate,
> CAM_CampaignStatus) VALUES (5, 'C0405', 'Campagne 2004-2005', '01/08/2004',
> '28/02/2005', 0)
> Is there anything wrong with the date format ? The corresponding columns are
> defined as datetime.
>
use yyyy-mm-dd as dateformat because it is language independend
Jens
>
|||On Thu, 29 Jul 2004 17:28:02 +0200, Ouaf wrote:
>Hello,
>I was developping with SQL Server and now I'm testing with MSDE.
>I meet a problem with SQL containing dates. My SQL is :
>INSERT INTO PIPT_Campaigns(CAM_CampaignId, CAM_CampaignCode,
>CAM_CampaignLabel, CAM_CampaignStartDate, CAM_CampaignEndDate,
>CAM_CampaignStatus) VALUES (5, 'C0405', 'Campagne 2004-2005', '01/08/2004',
>'28/02/2005', 0)
>Is there anything wrong with the date format ? The corresponding columns are
>defined as datetime.
>Thanks for any answer.
>
Hi Ouaf,
The date '28/02/2005' will probably be interpreted correctly, but
'01/08/2004' is ambiguous - it could be either DD/MM/YYYY or MM/DD/YYYY
(the default format in -amongst others- the USA).
It's best to use the internation standard date format YYYY-MM-DD; that is
always interpreted correctly.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Always use YYYYMMDD with SQL Server.
The following formats are all vulnerable to misinterpretations or errors due
to regional or language settings:
mm/dd/yyyy
dd/mm/yyyy
yyyy-mm-dd
http://www.aspfaq.com/
(Reverse address to reply.)
"Ouaf" <ouaf@.microsoft.com> wrote in message
news:#oO1kCYdEHA.2812@.tk2msftngp13.phx.gbl...
> Hello,
> I was developping with SQL Server and now I'm testing with MSDE.
> I meet a problem with SQL containing dates. My SQL is :
> INSERT INTO PIPT_Campaigns(CAM_CampaignId, CAM_CampaignCode,
> CAM_CampaignLabel, CAM_CampaignStartDate, CAM_CampaignEndDate,
> CAM_CampaignStatus) VALUES (5, 'C0405', 'Campagne 2004-2005',
'01/08/2004',
> '28/02/2005', 0)
> Is there anything wrong with the date format ? The corresponding columns
are
> defined as datetime.
> Thanks for any answer.
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment