Can I apply the DateAdd function to a field that has the varchar datatype?

  • I am wondering, all the fields that are supposed to represent date values are of the varchar datatype in the database I am currently working on.

    I need to manipulate the values of these fields? how does the Functions related to Dates handle these datatypes/

    I created a stored procedure and it compiled, however, I fear that when I execute the Stored Proc, it may cause problems.

    Any idea on this?

  • First, you can do that, but I recommend checking the table data with the IsDate function first. That way, you can find any that aren't going to work.

    Second, test it on a dev copy of the database, not the production copy. That way, if it blows anything up, it doesn't really matter.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks. I will try it.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply