DatePart Function

Results 1 to 2 of 2

Thread: DatePart Function

  1. #1
    Join Date
    Dec 1969

    Default DatePart Function

    HI,<BR><BR>Eddie helped me out earlier today by giving me the following code so I can reformat my form date field in to the correct format :<BR>ymdDate = Request.Form("myDate")<BR>dmyDate = DatePart("dd",dmyDate) & "/" & DatePart("mm",dmyDate) & "/" & DatePart("yyyy",mdyDate) <BR><BR>However I am getting the following error:<BR>Invalid procedure call or argument: &#039;DatePart&#039; <BR>Can anyone help me out ??<BR><BR>Kat<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: DatePart Function

    Don&#039;t keep changing the name of the date variable. In your first line you set it as ymdDate, so why are you changing it everytime to dmyDate, dmyDate, mdyDate??<BR><BR>You need to keep them the same as in the first line so it knows where to get the date from!!<BR><BR>Tip - If you had written "Option Explicit" at the top of your page (which is good coding practice) then this error would have been picked up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts