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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

putting ' on db fields, week() function, and commas every 3 digits

Status
Not open for further replies.

alex80

Technical User
Mar 20, 2004
2
IN
hello,
Question 1
i want to see what week number corresponds to a given date, is there such a function in ASP? something like week()?

Question2
Every time i have a field with the ' character in my database and i try to display it through ASP my ASP falls over! do you know a way to bypass this? or just dont use ' and " charaters in your DB??

Question 3
have posted it before but with no luck.
i have a number field that i want to display, but i want it to be displayed in a #,###,### format and not a ####### format.
how can i add the commas?


thanx!

plz if you know any answers i would be werry happy if you could help!

Alex

 
MS Access uses the single quote to mark the beginning and end of a field. If you take a field from your table with a quote in it, the quote is interpreted as the end of the field and characters after it cause the error as they are unlikely to be valid code.

To remedy the situation I think you need to change every occurrence of a single quote to two single quotes. So 'Dave's Shop' becomes 'Dave''s Shop'.

If you are updating a field with a quote in it, you should convert all the single quotes to two single quotes, perhaps by using a user-defined function such as the one below.

Code:
FUNCTION fixQuotes( theString )
  fixQuotes = REPLACE( theString, "'", "''" )
END FUNCTION

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top