Query a field with spaces in it

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Query a field with spaces in it

    I'm currently trying to run an update on a field in an Access database.

    <CFSET LINENUM=LINENUM+1>
    <CFQUERY NAme="UpdateRecords" DATASOURCE="CFACCESS">
    UPDATE tbl1 SET FIELD3='NumberFormat(LINENUM, '00') WHERE Field0='L' AND
    Field1='A B C D E F G'
    </CFQUERY>

    The data in Field1 has spaces in it. How can have the SELECT statement read
    the correct data with the spaces. I tried the TRIM function but it didn't work
    for me.

    i.e TRIM('A B C D E F G')

    Thanks.

    Thanks,
    Doug

    Frec Guest

  2. Similar Questions and Discussions

    1. Calculated Field in Query of Query
      How do you add a calculated field to a Query of Query using a function DollarFormat(datafield) as calcField
    2. multiple field query - plus
      I want to query an Access database through ASP. I want the query to return records based on parameters entered by the user, unless no parameter for...
    3. outputing field with spaces in name (bus addr)inmsaccess
      how to form the output for a field with a space in the name. Using MSAccess. <cfoutput> #members.# </cfoutput>doesn't work. Neither did about 5...
    4. Spaces being truncated in query / MID function gone?
      SELECT COUNT(DISTINCT PRES_CYCL_ID) is being changed to SELECT COUNT(DISTINCTPRES_CYCL_ID) If I response.Write the query, I see the space and...
    5. SQL Query with Field Conditionals???
      Try removing the quotes from around False? "Shannon" <scomins@unitedradio.com> wrote in message news:#WgOsZUTDHA.2092@TK2MSFTNGP10.phx.gbl......
  3. #2

    Default Re: Query a field with spaces in it

    For openers, you need # around your NumberFormat( ) function: '#NumberFormat( )#'. What are you trying to filter on Field1? Could you provide an example of the data in Field1?
    jdeline Guest

  4. #3

    Default Re: Query a field with spaces in it

    The data in field1 looks like the following:

    'AB 123 061301AB 244 0106 101'

    I'm going to try copy it from the field and paste it into my code. This may
    keep the format. Maybe I don't a function.

    Frec Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139