Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. SlashZero

    fn_formatdatetime (Format a datetime variable with a user-defined string)

    This UDF will take a datetime variable and a varchar format string variable. It will then pass back the date/time formated according to the format string. This is similar to the CONVERT function, but you are not limited to the predefined types of it. It works more like the Format function of...
  2. SlashZero

    Formating Date/Time with your own Format String

    Ok... Another bug correction... 'm/d/yy h:nnam/pm' would replace the 'm's in 'am/pm' with the month, then the 'am/pm' conversion wouldn't work... So, if you would like to try the function, here is the whole thing... Let me know if anybody has any problems. (I dropped the comment section at the...
  3. SlashZero

    Formating Date/Time with your own Format String

    Ok... using what clarkin explained... the nested IF block at the bottom can be changed to... IF CHARINDEX('m',@outStr,0) > 0 BEGIN IF CHARINDEX('mm',@outStr,0) > 0 BEGIN IF CHARINDEX('mmm',@outStr,0) > 0 BEGIN IF CHARINDEX('mmmm',@outStr,0) > 0 BEGIN SET @outStr = REPLACE(@outStr...
  4. SlashZero

    Formating Date/Time with your own Format String

    Thanks! I looked for something like INSTR in the String Functions in my SQL Help but couldn't find anything like it. That helps a lot! The CONVERT functin does provide several different formats but none of them quite matched the format I needed which is the reason for the format function...
  5. SlashZero

    Formating Date/Time with your own Format String

    In Access and Visual Basic this is a nice little "Format" function you can pass a date/time variable and a formating string and it returns the combined result. Like Format(Now(), "m/d/yy") Would return a string like "1/2/03". This function does not exist in SQL...

Part and Inventory Search

Back
Top