1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Day(Date) Type Mismatch error

Discussion in 'C#' started by nrobinson, Jan 10, 2007.

  1. #1
    I am new to ASP programming and I am trying to get an existing website to work.

    I have created the following function to get the day:

    function nrDate()
    nrDate = DAY(Date())
    end function

    But when I use the page it gives the following runtime error:

    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'DAY'

    I have googled the problem for hours but cannot find anything that may be helpfull. Does anyone have any ideas because this is getting quite urgent and I cannot move forward without this function.

    Best regards

    Nigel
     
    nrobinson, Jan 10, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
  3. DaDMan

    DaDMan Guest

    Messages:
    566
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yep.. also good references for learning could be found on w3schools..
    http://www.w3schools.com/vbscript/vbscript_ref_functions.asp

    on your function.. if you want to get the DAY "name" you'll have to use the "WeekdayName" function passing it the "Weekday" function.
    Weekday function will give you the number of the the current day starting from 1 to 7. 1 behing Sunday ( by default )
    i.e weekdayname(weekday) will return "Thursday" ( according my time off course.. estern that is )

    Checking your function:
    function nrDate()
    nrDate = DAY(Date())
    end function

    I guess you wanted to get the actual number of the month?
    so your ok with with what you did.. but just get rid of the parentheses on the Date parameter in the DAY function..

    function nrDate()
    nrDate = DAY(Date)
    end function

    Should work fine.. ( did'nt test it thought.. ) :) but should be just fine..
    Cheers
     
    DaDMan, Jan 10, 2007 IP