Results 1 to 4 of 4

Thread: [RESOLVED] What does it mean ? Data type ....

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Resolved [RESOLVED] What does it mean ? Data type ....

    Hi,

    Why this error occurs and what does it mean?

    Data type missmatch in criteria expression and highlights the following code:

    VB Code:
    1. rs.Open "Select format(DDate,""mm"") ,sum(Amount)as Jan from Collections where format(DDate,""mm"")=1 group by format(DDate,""mm"") ", db, adOpenDynamic, adLockOptimistic

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: What does it mean ? Data type ....

    You can't use FORMAT in an SQL query. It is not a recognized function.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,500

    Re: What does it mean ? Data type ....

    Indeed... what you can use tho is an SQL function called Month, eg:

    VB Code:
    1. rs.Open "Select Month(DDate), sum(...

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: What does it mean ? Data type ....

    Quote Originally Posted by si_the_geek
    Indeed... what you can use tho is an SQL function called Month, eg:
    VB Code:
    1. rs.Open "Select Month(DDate), sum(...
    Quote Originally Posted by Hack
    You can't use FORMAT in an SQL query. It is not a recognized function.
    Thank you very much to both of you for the help.

    Seema.

Posting Permissions

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



Click Here to Expand Forum to Full Width