Results 1 to 6 of 6
  1. #1
    jovawe is offline Novice
    Windows 11 Office 365
    Join Date
    Mar 2024
    Posts
    3

    Post you may have entered an operand without an operator

    Hi All,

    I'm always getting the error message when I try the following:

    Int("99"+CStr(IIf(Day([tblActuals]![ActualsDate])<10,"0" & CStr(Day([tblActuals]![ActualsDate])),Day([tblActuals]![ActualsDate])))+CStr(IIf(Month([tblActuals]![ActualsDate])<10,"0" & CStr(Month([tblActuals]![ActualsDate])),Month([tblActuals]![ActualsDate])))+CStr(Year([tblActuals]![ActualsDate])))

    What I want with the expression is that the ActualsDate is concatenated behind the String "99" and then turned into an Integer e.g. 9907032024.



    Access indicates the error on the first "0".

    Any ideas?

    Best regards
    Johan

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Jeez,
    Start slowly and add one at a time.
    Why not just use Format() ?

    Access also use & to concatenate. + is only if there could be Nulls.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    jovawe is offline Novice
    Windows 11 Office 365
    Join Date
    Mar 2024
    Posts
    3
    even when I only try IIf(Day( [tblActuals]![ActualsAmount] )<10,"0", [tblActuals]![ActualsAmount] ) it comes up with the error

    how could I use Format() ?

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by jovawe View Post
    even when I only try IIf(Day( [tblActuals]![ActualsAmount] )<10,"0", [tblActuals]![ActualsAmount] ) it comes up with the error

    how could I use Format() ?
    Have you even thought of looking up the syntax?

    Code:
    tt="99" & Format(date,"ddmmyyyy")
    ? tt
    9907032024
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    jovawe is offline Novice
    Windows 11 Office 365
    Join Date
    Mar 2024
    Posts
    3
    how easy can a problem be solved...
    To be honest...no I didn't look to the Format syntax....I was a bit frustrated after have spend multiple hours looking, reading why the error was there

    Anyway Many thanks for the very quick response and solution !

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by jovawe View Post
    how easy can a problem be solved...
    To be honest...no I didn't look to the Format syntax....I was a bit frustrated after have spend multiple hours looking, reading why the error was there

    Anyway Many thanks for the very quick response and solution !
    TBH, I could not decipher that easily, so I do not know what the issue is, just that there is an easier way.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 18
    Last Post: 02-26-2018, 03:42 PM
  2. Operand without an operator error
    By mdnikki in forum Queries
    Replies: 4
    Last Post: 08-28-2017, 02:33 PM
  3. Operand without an operator error
    By Thompyt in forum Programming
    Replies: 3
    Last Post: 04-15-2015, 04:38 PM
  4. Operand without operator or
    By burrina in forum Queries
    Replies: 2
    Last Post: 12-31-2012, 06:14 PM
  5. Like operand in Iif Or expression
    By Hwyn9a in forum Queries
    Replies: 2
    Last Post: 03-05-2011, 01:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums