---
title: "problem med select-sats"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/109545-problem-med-select-sats"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "rollo"
published: "2004-08-18T17:44:12.000Z"
updated: "2004-08-18T19:43:36.000Z"
replies: 4
views: 266
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/109545-problem-med-select-sats"
---

# problem med select-sats

## #1 — rollo, 2004-08-18T17:44Z

tjena

håller på att lägga in ett extra språk på en site och har lite problem med sökmotorn.

Vill avgränsa sökresultatet efter vilket språk besökaren valt.
Detta är SQL-satsen som jag använder

```
		tmp_f = request("falt01")

SQL = "Select * From db_h Where falt01 " &_
falt01 & " Like '%" & Request.Form("falt01") & "%' OR falt02 Like '%" & Request.Form("falt01") & "%' OR falt03 Like '%" & Request.Form("falt01") & "%' OR falt04 Like '%" & Request.Form("falt01") & "%' OR text01 Like '%" & Request.Form("falt01") & "%' OR text02 Like '%" & Request.Form("falt01") & "%' OR text03 Like '%" & Request.Form("falt01") & "%' OR text04 Like '%" & Request.Form("falt01") & "%' OR text05 Like '%" & Request.Form("falt01") & "%' OR text06 Like '%" & Request.Form("falt01") & "%'"
```

Är helt lost, vill ha in AND lang = &" tmp_lang
Men, hur fasiken får jag dit det?

hjälp, fattar inget!!

rollo

Permalänk: https://www.webforum.nu/p/109545

## #2 — cyprys, 2004-08-18T17:50Z

```
tmp_f = request("falt01")
SQL = "Select * From db_h Where falt01 " & _
"lang = "& tmp_lang &" AND (falt01 Like '%" & tmp_f & "%' " & _
"OR falt02 Like '%" & tmp_f & "%' " & _
"OR falt03 Like '%" & tmp_f & "%' " & _
"OR falt04 Like '%" & tmp_f & "%' " & _
"OR text01 Like '%" & tmp_f & "%' " & _
"OR text02 Like '%" & tmp_f & "%' " & _
"OR text03 Like '%" & tmp_f & "%' " & _
"OR text04 Like '%" & tmp_f & "%' " & _
"OR text05 Like '%" & tmp_f & "%' " & _
"OR text06 Like '%" & tmp_f & "%')"
```

Permalänk: https://www.webforum.nu/p/1415965

## #3 — LeonL, 2004-08-18T17:50Z

r\\ Hoppsan, lite sen. ;)

Permalänk: https://www.webforum.nu/p/1415966

## #4 — rollo, 2004-08-18T18:12Z

UNDERBART!!

Tack cyprys!
Den funkade, nästan, tog bort falt01 från första raden på SELECT-satsen!

TACK!

Detta blev koden

```
SQL = "Select * From db_h Where " & _
"lang = "& tmp_lang &" AND (falt01 Like '%" & tmp_f & "%' " & _
"OR falt02 Like '%" & tmp_f & "%' " & _
"OR falt03 Like '%" & tmp_f & "%' " & _
"OR falt04 Like '%" & tmp_f & "%' " & _
"OR text01 Like '%" & tmp_f & "%' " & _
"OR text02 Like '%" & tmp_f & "%' " & _
"OR text03 Like '%" & tmp_f & "%' " & _
"OR text04 Like '%" & tmp_f & "%' " & _
"OR text05 Like '%" & tmp_f & "%' " & _
"OR text06 Like '%" & tmp_f & "%')"
```

rollo

Permalänk: https://www.webforum.nu/p/1415979

## #5 — cyprys, 2004-08-18T19:43Z

:r oops. Den slank in där ja.

Permalänk: https://www.webforum.nu/p/1416054

---

Tråden på webben: https://www.webforum.nu/amne/asp/109545-problem-med-select-sats
