Date frustration

From: Drew (drew.laing_at_NOswvtc.dmhmrsas.virginia.SPMgov)
Date: 01/24/05


Date: Mon, 24 Jan 2005 15:12:56 -0500

I screwed up when building my application, now I need to try to fix it...
Initially I setup my dates in a varchar field, now I need them in a datetime
field...

I have the following query that is acting funny,

UPDATE tblEmpPersonalInfo SET
 SepDate = EmpSWVTCSepDate

This query will not successfully run, giving me this error,

The conversion of a char data type to a datetime data type resulted in an
out-of-range datetime value.
The statement has been terminated.

But, if I edit the query like this,

UPDATE tblEmpPersonalInfo SET
 SepDate = EmpSWVTCSepDate
WHERE EmpID = 'aa381234'

then the query will work fine... I don't want to have to run the query for
every employee in the database, so how can I do this?

Thanks,
Drew



Relevant Pages

  • Query Data using Date
    ... Install SQL Server 2000 Developer Edition. ... I want to query a table which contains a column of data type datetime using ...
    (microsoft.public.sqlserver.programming)
  • Re: [PHP] Mysql strategy
    ... > If I have to perform 30 LIKE searches for different keywords in a ... > 2) To select the varchar field from all the rows, ... If you are worried about the speed of this query I'd suggest rethinking ... your database structure. ...
    (php.general)
  • Converting a field from int to varchar during query
    ... field2 is a varchar field and field1 is an int field. ... How do I run this query without getting the error - "Syntax error converting ...
    (microsoft.public.sqlserver.mseq)
  • Re: [PHP] Mysql strategy
    ... To select the varchar field from all the rows, ... If you are worried about the speed of this query I'd suggest rethinking your database structure. ... Text field comparisons will always be relatively slow compared to numeric comparisons or numeric lookups. ...
    (php.general)
  • Re: Problems formatting Date in a listBox
    ... > the Field is datetime ... Is this from the same query being executed from the VB code? ... problem with the data type of the database column. ...
    (microsoft.public.vb.database.ado)