Lesson10 Create Queries

21
Abdullatif Tarakji [email protected] Create queries Create a query مء استع إنشا- Modify queries ماتستع تعديل ا- Utilize calculated fields and grouping within queries ماتستع في المحسوبة و تضمينهاحقول ا استخدام ال

Transcript of Lesson10 Create Queries

Abdullatif [email protected]

Create queries

Create a query إنشاء استعالم-

Modify queries تعديل االستعالمات-

Utilize calculated fields and grouping within queries

استخدام الحقول المحسوبة و تضمينها في االستعالمات

Abdullatif [email protected]

Create a query إنشاء استعالم-

• Running queries تشغيل االستعالمات

• Saving and deleting queries حفظ و حذف االستعالمات

• Creating select queries إنشاء استعالمات التحديد

• Using the Simple Query wizard استخدام معالج االستعالم البسيط

• Using the Query Designer استخدام مصمم االستعالم

• Creating parameter queries إنشاء استعالمات معلمة

Abdullatif [email protected]

• Queries help you manage database records, locate records that match specific criteria, and analyze data. For example, a make-table query or an append query (two types of action queries) are often used to archive records. With a select query, you can retrieve records for all orders or add criteria to select a specific set of records (for example, only orders placed within the past 90 days that exceed a certain dollar amount).

• This chapter guides you in studying methods for creating queries. It also describes how to manage tables and relationships in queries. In addition, the chapter explains how to manage fields and sort records in a query, how to group and summarize values, how to create calculated fields, and how to work with expressions and operators to define query criteria.

حديد ت, االستعالمات تساعدك بإدارة سجالت قاعدة البيانات•

كمثال . اتو تحليل البيان, السجالت التي تطابق معايير محددة

نوعين من )إلحاق استعالم , انشاء استعالم جدولي

مع . تغالبا تستخدم ألرشفة السجال( االستعالمات النشطة

طلبيات أو يمكنك استرجاع السجالت لكافة ال, استعالم التحديد

إضافة معايير الختيار مجموعة من السجالت المحددة

يوم و التي 90فقط الطلبيات التي وضعت آخر , كمثال)

.تزيد مقدار معين من المال

ضا أي. هذا الدرس يدلك على دراسة أساليب انشاء االستعالم•

.تشرح كيفية إدارة الجداول و العالقات في االستعالم

سجالت الدرس يشرح كيفية إدارة الحقول و فرز ال, باإلضافة

شاء الحقول كيفية ان, كيفية تجميع و جمع القيم, في االستعالم

تعريف و كيفية العمل مع التعابير و المشغالت ل, المحسوبة

.معايير االستعالم

Abdullatif [email protected] Running queries

تشغيل االستعالمات• The simplest way to run a query is to double-click its

entry in the Navigation pane. This action displays the query’s results in Datasheet view, where you can then sort and filter the records, export the query’s data, and perform other operations. You can also right-click a query in the Navigation pane and then click Open to run the query.

• In the Query Designer, as you add or remove fields and define criteria and other query properties, use the Run command in the Results group (on the Query Tools Design tool tab) to view the records that the query returns. You can return to Design view (by using the View menu on the Home tab), make additional modifications to the query, and then run the query again to check the effects of the changes.

To run a query

• In the Navigation pane, double-click the query.

• In Design view, click Run on the Query Tools Design tool tab.

على الطريقة األبسط لتشغيل االستعالم هي بالضغط نقرتين•

نتائج هذه الطريقة تظهر. االستعالم المطلوب من نافذة جزء التنقل

فية حيث يمكنك فرز و تص, االستعالم في عرض ورقة البيانات

. و انجاز عمليات أخرى, تصدير بيانات االستعالم, السجالت

جزء يمكنك ايضا الضغط بزر ماوس اليمين على االستعالم في

.التنقل ثم اضغط أمر فتح لتشغيل االستعالم

من مصمم االستعالم حيث إضافة و إزالة الحقول و تعريف •

ن استخدم أمر تشغيل م, المعايير و خصائص أخرى لالستعالم

, (ممن تبويب أدوات االستعالم أدوات التصمي)مجموعة النتائج

عالم مرة ثم تشغيل االست, نقوم بعمل تعديالت إضافية لالستعالم

.أخرى لتدقيق تأثيرات التغيير

:لتشغيل االستعالم

.اضغط نقرتين على االستعالم, من جزء التنقل•

اضغط على تشغيل من أدوات االستعالم , من عرض التصميم•

.تبويب أداة التصميم

Abdullatif [email protected]

, من جزء التنقل1.

ى اضغط نقرتين عل

.االستعالم

ى أو كليك يمين عل2.

االستعالم و اضغط

فتح من القائمة

المختصرةاضغط على تشغيل من أدوات, من عرض التصميم

.التصميم من مجموعة نتائجاالستعالم تبويب

Abdullatif [email protected] Saving and deleting queries

حفظ و حذف االستعالمات• Access automatically saves a query you create by

using one of the query wizards. When you design a query from scratch in the Query Designer, Access assigns a default name to the query (Query1, for example). To name and save the query, click the Save button on the Quick Access Toolbar, or click the Save command in the Backstage view.

• You can use options on the Save As page in the Backstage view to create a copy of a query as a new database object (by choosing Save Object As) or as a PDF or an XPS file. The Save Object As command can be helpful if you want to experiment with a query that’s already designed (by adding additional selection criteria, for example) and don’t want to risk inadvertent changes to the original query.

• To delete a query from a database, right-click the query in the Navigation pane, and then click Delete. Queries are often used as the record source for forms and reports. If you delete a query that’s the basis of a form or report, you need to update the record source before you can use the form or report to view records.

ة معالج برنامج األكسيس يحفظ تلقائيا االستعالم المنشئ بواسط•

رنامج ب, عند تصميم االستعالم في مصمم االستعالم. االستعالمات

لتسمية و (. كمثال1استعالم)االكسيس يحدد اسم افتراضي لالستعالم

أو , حفظ االستعالم اضغط على زر حفظ من شريط األدوات السريع

.اضغط على امر حفظ من عرض منصة العمل قائمة ملف

نشاء يمكن استخدام الخيارات في صفحة حفظ باسم من قائمة ملف إل•

, ككائننسخة من االستعالم ككائن قاعدة بيانات جديد باختيارك حفظ

حفظ كائن كأمر يمكنه مساعدتك اذا . XPSأو كملف PDFأو كملف

تحديد بإضافة معيار)كنت تريد تجربته مع استعالم مصمم اساسا

.و ال تريد أي مخاطر تحدث لالستعالم األصلي( محدد كمثال

ستعالم اضغط كليك يمين على اال, لحذف استعالم من قاعدة البيانات•

. في نافذة جزء المهام ثم اضغط على حذف االستعالمات غالبا

عالم و اذا قمت بحذف است. تستخدم مصدر السجل للنماذج و التقارير

ل ان تحتاج لتحديث مصدر السجل قب, هو أساسي لنموذج او تقرير.تستخدم النموذج و التقرير لعرض السجالت

Abdullatif [email protected] To save a query لحفظ استعالم-

1. On the Quick Access Toolbar, click Save.

2. In the Save As dialog box, enter a name for the

query and then click OK.

.من شريط األدوات السريع اضغط حفظ1.

.قمن صندوق حوار حفظ باسم أدخل اسم االستعالم ثم اضغط على مواف2.

To delete a query لحذف استعالم-

In the Navigation pane, right-click the

query, and then click Delete.

الم من نافذة جزء التنقل اضغط كليك يمين على االستع

المطلوب حذفه ثم اضغط حذف

Abdullatif [email protected]

Creating select queries إنشاء استعالمات التحديد

• A select query returns all or a subset of the records stored in one or more tables. When creating a select query, you specify which fields you want to use, and you can also define criteria to return a specific set of records. One simple use for a select query is to set up a record source for a mailing list. For example, by using a contacts table as the basis for the query, you could include name, address, and related fields in the query without adding fields for a contact’s email address and phone number. If you’re sending a mailing to contacts in specific locations, you could define criteria that limits the records the query returns to contacts in the particular cities or postal codes you designate.

• Select queries (and queries of other types) also illustrate the purpose of table relationships. You can add two or more tables to a query and use their relationship to retrieve a set of records from all the tables—for example, all high-priority tasks related to projects for a particular customer, managed by a specific employee, and with a completion date within 30 days.

• To create a select query, you can use the Simple Query wizard or build the query by using the Query Designer. Use the Query Designer if you want to add criteria to the query.

مجموعة فرعية من السجالت يقوم بإرجاع كافة السجالت أو استعالم تحديد •

حقول عند إنشاء استعالم تحديد، يمكنك تحديد ال. المخزنة في جدول واحد أو أكثر

التي تريد استخدامها، ويمكنك أيضا تحديد معايير إلرجاع مجموعة محددة من

صول مصدر سجل للحاعداد تحديد هو طريقة بسيطة الستخدام استعالم . السجالت

على سبيل المثال، باستخدام الجدول االتصاالت كأساس. على قائمة بريدية

ي ذات الصلة فوحقول والعنوان، يشمل االستعالم االسم أن يمكن لالستعالم،

. الهاتفاالستعالم دون إضافة حقول لعنوان البريد اإللكتروني لجهة االتصال ورقم

أن تحدديمكن لجهات االتصال في مواقع محددة، البريد إذا كنت تقوم بإرسال

معينة المعايير التي تحد من سجالت االستعالم بإرجاع إلى جهات االتصال في مدن

.تصممأو الرموز البريدية التي

الغرض من توضح أيضا ( أخرىواستعالمات من أنواع )استعالمات التحديد •

ام واستخدلالستعالم يمكنك إضافة اثنين أو أكثر من الجداول . عالقات الجدول

العالقة بينهما السترداد مجموعة من السجالت من كافة الجداول، على سبيل

يديرها المثال، جميع المهام ذات األولوية العالية المتعلقة بالمشاريع لعميل معين،

.يوما30موظف معين، مع وجود تاريخ االنتهاء في غضون

تعالم إلنشاء استعالم تحديد، يمكنك استخدام معالج استعالم بسيط أو بناء االس•

افة استخدام مصمم االستعالم إذا كنت ترغب في إض. باستخدام مصمم االستعالم.االستعالممعايير إلى

Abdullatif [email protected]

Using the Simple Query wizard استخدام معالج االستعالم البسيط

• To start the Simple Query wizard, click Query Wizard in theQueries group on the Create tab. In the New Query dialogbox, select Simple Query Wizard. In the next step, addfields from one or more tables (or queries) to define thequery you’re creating.

The Simple Query wizard tailors its steps based on factorssuch as the following:

• If you add fields from only one table and those fields storeonly text data (not numeric data), the third and last step isto provide a name for the query and then specify whetherto open the query to view the records it returns or openthe query in Design view for modification.

• If you include numeric or date fields or fields from morethan one table, the wizard prompts you to create a detailquery or a summary query. A detail query shows eachindividual record for the query. In a summary query, youcan total the values in a field or determine the field’saverage, minimum, or maximum value.

• When date fields are present in a summary query, thewizard also prompts you to choose an option for how youwant to group records by dates. For example, you cangroup records by month, quarter, or year.

مات في لبدء معالج استعالم بسيط، انقر فوق معالج االستعالم في مجموعة استعال•

. سيطفي مربع الحوار استعالم جديد، حدد معالج استعالم ب. عالمة التبويب إنشاء

( االستعالماتأو )في الخطوة التالية، إضافة حقول من واحد أو أكثر من الجداول

.الذي تريد إنشائهلتحديد االستعالم

:خطوات معالج االستعالم البسيط مرتبطة مع بعضها على حسب العوامل التالية

ية النصالبيانات تخزن قمت بإضافة حقول من جدول واحد فقط، وتلك الحقول إذا •

و هي ة الثالثة واألخير، تنتقل مباشرة الى الخطوة (وليس البيانات الرقمية)فقط

التي الت االستعالم لعرض السجطريقة فتح ثم تحديد و من لتوفير اسم لالستعالم

.لتعديل تصميمهأو فتح االستعالم في طريقة عرض التصميم يتم ارجاعها

ول أكثر من جدحقول رقمية أو حقول تاريخ و وقت أو حقول من قمت بتضمين إذا •

ويظهر. يطالبك المعالج إلنشاء استعالم التفاصيل أو استعالم ملخصواحد،

. االستعالم التفاصيل كل سجل الفردية لالستعالم

ي، أو المتوسط الحسابالقيم في حقل أو تحديد ملخص، يمكنك جمع استعالم في

.األدنى للحقل، أو القيمة القصوىالحد

تيار استعالم ملخص حقول التاريخ، المعالج أيضا يطالبك الخوعندما تعرض في •

كن تجميع على سبيل المثال، يم. خيار لكيف تريد لتجميع السجالت حسب التواريخ.السنةأو ربع السنة، السجالت حسب الشهر،

Abdullatif [email protected] To create a select query by using the Simple Query wizard

إلنشاء استعالم تحديد باستخدام معالج االستعالمات البسيطة

1. On the Create tab, in the Queries group, click Query Wizard.

2. In the New Query dialog box, select Simple Query Wizard, and then click OK.

3. In the Simple Query wizard, in the Tables/Queries list, select the first table or query you want to use for this query. From the Available Fields list, add the fields you want to include in the query to the Selected Fields list. Click the chevron button to move all the fields to the Selected Fields list.

4. Repeat step 3 to include other tables or queries in the select query, and then add the fields you want to include. Click Next.

5. If the query includes numeric fields or fields from more than one table, the wizard prompts you to create a detail query or a summary query. If you select the Summary option, click Summary Options, and then select the summary function you want to apply to the fields that Access lists. Click OK in the Summary Options dialog box, and then click Next.

6. If prompted by the wizard, choose an option to group dates in the query.

7. On the wizard’s last page, enter a name for the query, and then choose whether to open the query to review the results or open the query in Design view.

.اتاضغط على معالج االستعالم, من مجموعة استعالمات, من تبويب إنشاء1.

.قاختر معالج االستعالم البسيط ثم مواف, جديدمن مربع حوار استعالم 2.

دول او اختر الج, من قائمة جداول و استعالمات, في معالج االستعالم البسيط3.

من قائمة الحقول. االستعالم األول الذي تريد استخدامه في االستعالم

ئمة الحقول أضف الحقول التي تريد تضمينها في االستعالم الى قا, المتوفرة

اضغط على زر اختيار الكل لتحريك جميع الحقول الى قائمة. المحددة

.الحقول المحددة

ثم لتضمين جداول او استعالمات أخرى في االستعالم المحدد3كرر الخطوة4.

.ثم اضغط التالي. أضف الحقول التي تريد تضمينها

ج المعال, كان االستعالم يتضمن حقول رقمية أو حقول من جداول أخرىاذا 5.

ار اذا اخترت خي. يطالب إلنشاء تفصيل االستعالم او استعالم ملخص

طبيقها ثم اختر الداالت التي تريد ت, اضغط على خيارات التلخيص, ملخص

ت اضغط موافق في مربع حوار خيارا. للحقول التي يعرضها االكسيس

.ثم اضغط التالي, التلخيص

.اختر خيار لتجميع التواريخ في االستعالم, اذا طالبك المعالج6.

ح ثم اختر طريقة فت, ادخل اسم لالستعالم, في آخر صفحة من المعالج7..تعديلهاالستعالم لعرض النتائج أو فتح االستعالم في عرض التصميم ل

Abdullatif [email protected]

Abdullatif [email protected]

If the query includes numeric fields or fields from more than one table, the wizard prompts you to create a detail query or a summary query. If you select the Summary option, click Summary Options, and then select the summary function you want to apply to the fields that Access lists. Click OK in the Summary Options dialog box, and then click Next.

اذا كان االستعالم يتضمن حقول رقمية أو حقول من

تعالم االستفصيل المعالج يطالب إلنشاء , جداول أخرى

اضغط, ملخصاذا اخترت خيار . او استعالم ملخص

ريد ثم اختر الداالت التي ت, التلخيصعلى خيارات

ط موافق اضغ. تطبيقها للحقول التي يعرضها االكسيس

.اليثم اضغط الت, التلخيصفي مربع حوار خيارات

Abdullatif [email protected] Using the Query Designer

استخدام مصمم االستعالم• Use the Query Design command on the Create tab to open

the Query Designer. The Query Designer displays the query design grid (below the main pane) and the Show Table dialog box.

• The Show Table dialog box lists all the tables and queries in the current database. Click a tab (Tables, Queries, or Both) to select the object or objects that contain the fields you want to include in the query. Close the Show Table dialog box to start adding fields to the query.

• If you need to add tables to a query later, open the query in Design view, and then click Show Table in the Query Setup group on the Query Tools Design tool tab. You can also right-click in the Query Designer’s main pane (but not on a field list), and then click Show Table. If you need to remove a table from the Query Designer, right-click the table’s field list, and then click Remove Table.

• Drag the field lists in the Query Designer’s main pane to reposition the lists and view more clearly the relationship lines that link tables. To add a field to the query, drag it from the field list to the Field row in a blank column in the design grid. (You can press Ctrl or Shift to select multiple fields.) You can also select fields from the list displayed when you click the arrow at the right of a column in the Field row. To add all the fields in a table to the query design grid, double-click the asterisk (*) at the top of the field list.

يعرض . الماستخدام األمر تصميم االستعالم ضمن عالمة التبويب إنشاء لفتح مصمم االستع•

مربع ار إظهو( الجزء الرئيسيفي األسفل من )مصمم االستعالم شبكة تصميم االستعالم

.جدولالحوار

. ةيسرد مربع الحوار إظهار جدول كافة الجداول واالستعالمات في قاعدة البيانات الحالي•

نات لتحديد الكائن أو الكائ( كالهماالجداول، االستعالمات، أو )انقر فوق عالمة التبويب

ظهار إغالق مربع الحوار إ. التي تحتوي على الحقول التي تريد تضمينها في االستعالم

.جدول لبدء إضافة حقول إلى االستعالم

ي طريقة إذا كنت بحاجة إلى إضافة الجداول إلى االستعالم في وقت الحق، افتح االستعالم ف•

في أدواتفي المجموعة إعداد االستعالم إظهار جدولعرض التصميم، ومن ثم انقر فوق

سي الماوس األيمن فوق في الجزء الرئيالضغط بزر يمكنك أيضا . أداة تصميمتبويب

إذا كنت . ثم انقر فوق إظهار جدول، (قائمة الحقولولكن ليس على )مصمم االستعالم

بحاجة إلى إزالة الجدول من مصمم االستعالم، انقر بزر الماوس األيمن قائمة الحقول

.للجدول، ثم انقر فوق إزالة الجدول

ثر االستعالم إلعادة القوائم وعرض أكلمصمم الجزء الرئيسي الحقل في اسحب قوائم •

ه من إلضافة حقل إلى االستعالم، اسحب. العالقة التي تربط بين الجداوللخطوط وضوحا

. قائمة الحقول إلى صف الحقول في عمود فارغ في شبكة التصميمن أيضا تحديد الحقول ميمكنك .( لتحديد حقول متعددةShiftأو Ctrlيمكنك الضغط على )

. قائمة عرض عند النقر فوق السهم على يمين عمود في الصف حقل

ق النجمة نقرا مزدوجا فوانقر كافة الحقول في جدول إلى شبكة تصميم االستعالم، إلضافة .في الجزء العلوي من قائمة الحقول)*(

Abdullatif [email protected]

• As mentioned earlier, a select query often includes criteria that defines the subset of records the query returns when you run it. For example, to find records for customers in a specific city, add the City field to the query. In the Criteria row for that field, enter =”CityName” (where “CityName” is the city you want to examine). You must enclose text values in quotation marks.

• To specify criteria for a date field, enclose the date (or dates) in pound signs (#). You can retrieve records for orders placed between two dates by using an expression such as Between #4/1/2014# and #4/30/2014#. You can also use operators to retrieve records less than (<) or greater than (>) a certain numeric amount.

يير التي ما تتضمن المعاالتحديد غالبا استعالم سابق، كما ذكر في وقت •

لى ع. عند تشغيلهبإرجاعها من سجالت االستعالم مجموعة فرعية تحدد

ة الحقل سبيل المثال، للبحث عن سجالت للعمالء في مدينة معينة، إضاف

،في الصف معايير لهذا الحقل. إلى مدينة االستعالم

« اسم المدينة»= أدخل

(. فحصهاالمدينة التي تريد هي « اسم المدينة»حيث )

.في عالمات اقتباسصية عليك تضمين قيم نيجب

المات في ع( أو التواريخ)لتحديد معايير لحقل التاريخ، إحاطة التاريخ •

يمكنك استرداد السجالت ألوامر وضعت بين تاريخين(. #)الهاش

تاريخينبين مثل باستخدام تعبير

Between #4/1/2014# and #4/30/2014# .

أيضا استخدام المشغلين السترداد السجالت يمكنك

.معينرقمي ( <)أو أكبر من ( >)من أقل

Abdullatif [email protected]

• When you enter criteria in the Criteria row for more than one field, the query selects only records that match the criteria in all those fields—for example, records that have a value in the Order Date field greater than 9/15/2013 and a value for the Company Name field of Fabrikam. If you want to set up OR criteria (to find records with a value in the Company Name field of Fabrikam or Contoso), enter the second criteria in the Or row (below the Criteria row).

• In the Query Setup group, use the Return list (the ScreenTip reads Top Values) to limit the number of records the query returns. By default, a query returns all matching records, but you can select one of the preset values (5, 25, 100, 5%, or 25%) or enter a value in the list box to specify how many records you want to display. After you sort records in a query, you can use the Return list to show, for example, the top 20 orders that customers placed in the current month.

ار معايير ألكثر من حقل واحد، االستعالم يختصف إدخال معايير في عند •

السجالت الوحيدة التي تطابق المعايير في جميع هذه المجاالت

سبيل المثال، على

التي تحتوي على قيمة في التاريخ ترتيب الحقل أكبر من السجالت

كنت ترغب إذا .Fabrikamو قيمة للحقل اسم الشركة من 2013/9/15

للبحث عن سجالت مع القيمة في حقل اسم الشركة)في إعداد أو معايير

أوفي الصف المعيار الثاني أدخل ، (Contosoشركة أو Fabrikamمن

(.من صف المعاييرفي األسفل )

رأ تلميح الشاشة يق)في المجموعة إعداد االستعالم استخدام قائمة العودة •

ي، بشكل افتراض. إرجاع االستعالمالسجالت في للحد من عدد ( أعلى القيم

ن القيم السجالت المتطابقة، ولكن يمكنك اختيار واحد ميرجع كافة االستعالم

أو إدخال قيمة في مربع ( ٪25٪، أو 5، 100، 25، 5)المحددة مسبقا

. القائمة لتحديد عدد السجالت التي تريد عرضها

على فرز السجالت في استعالم، يمكنك استخدام قائمة العودة للعرض،بعد

.في الشهر الحاليطلبوها العمالء طلبية التي 20أعلى سبيل المثال، فإن

Abdullatif [email protected] To create a select query in Design view

إلنشاء استعالم تحديد في عرض التصميم

1. On the Create tab, in the Queries group, click Query Design.

2. In the Show Table dialog box, select the tables or queries you want

to use in the query. Click Add to add the objects to the Query

Designer, and then click Close.

3. From the field lists, drag the fields you want to include in the

query to the Field row in the query design grid. (You can also select

fields from the list that Access displays when you click the arrow in

the Field row in the query design grid.)

4. Define selection criteria for the query in the Criteria row and the

Or row depending on which records you want the query to return.

5. In the Results group on the Query Tools Design tool tab, click Run

to display the records returned by the query.

.اضغط مصمم االستعالم, في مجموعة استعالم, من تبويب إنشاء1.

اختر الجدول أو االستعالم الذي تريد , من مربع حوار إظهار جدول2.

مصمم اضغط على إضافة إلضافة الكائنات ل. استخدامه في االستعالم

.ثم اضغط اغالق, االستعالم

تعالم الى اسحب الحقول التي تريد تضمينها في االس, من قائمة الحقول3.

ار الحقول يمكن أيضا اختي. )سطر الحقل في شبكة تصميم االستعالم

طر من القائمة التي يظهرها األكسيس عند الضغط على السهم في س

(.الحقول في شبكة تصميم االستعالم

عرف المعايير المحددة لالستعالم في سطر المعايير و سطر أو 4.

.باالعتماد على السجالت التي تريد استردادها

, ميمفي مجموعة النتائج من أدوات االستعالم في تبويب أدوات التص5.

.اضغط تشغيل إلظهار السجالت المستردة لالستعالم

Abdullatif [email protected]

123

45

6

Abdullatif [email protected]

To add tables to a query

1. Open the query in Design view.

2. On the Design tool tab, in the Query Setup group, click Show Table.

3. In the Show Table dialog box, select the tables or queries you want to add, click Add, and then click Close.

To remove a table from a query

1. Open the query in Design view.

2. Right-click the field list for the table, and then click Remove Table.

:إلضافة جداول الى االستعالم

.افتح االستعالم في عرض التصميم1.

في مجموعة اعداد , من تصميم أدوات التصميم2.

.اضغط إظهار جدول, االستعالم

اختر الجداول أو , من صندوق حوار إظهار جدول3.

اضغط ثم, اضغط إضافة, االستعالمات التي تريد اضافتها

.اغالق

:إلزالة جدول من االستعالم

.افتح االستعالم في عرض التصميم1.

, اضغط زر ماوس اليمين على قائمة الحقل للجدول2.

.ثم اضغط إزالة جدول

Abdullatif [email protected] Creating parameter queries

إنشاء استعالمات معلمة• A parameter query (a type of select query) provides

flexibility in applying criteria. Instead of adding criteria such as =”Los Angeles” to the City field, you define a parameter for that field by using a format and prompt such as [Enter City Name]. With a parameter defined, you can use a single query to retrieve different sets of records based on the value you enter for the parameter.

• To define a parameter, click in the Criteria row for the field you want to work with, and then enter a prompt enclosed in square brackets. For example, to create a parameter for the City field, enter [Enter a city name] or a similar prompt. When you run the query, Access displays the Enter Parameter Value dialog box, which displays the prompt you defined. Enter the value you want to use as criteria (for example, Chicago or Montreal for the city parameter), and then click OK. Access returns the set of records that match the criteria you provide.

• The second step in defining a query parameter is to specify the parameter’s data type. Click Parameters in the Show/Hide group on the Query Tools Design tool tab. In the Query Parameters dialog box, enter the parameter name (including the brackets) just as it appears in the design grid. In the Data Type column, select the data type (such as Short Text or Date With Time) that matches the field you defined the parameter for.

. المعاييريوفر المرونة في تطبيق( وهو نوع من استعالم تحديد)استعالم المعلمة •

حدد ، عليك أن تحقل المدينةإلى " لوس أنجلوس= "بدال من إضافة معايير مثل

معلمة مع[. أدخل اسم مدينة]التنسيق و المطالبة مثل معلمة لهذا الحقل باستخدام

ت محددة، يمكنك استخدام استعالم واحد السترداد مجموعات مختلفة من السجال

.استنادا إلى القيمة التي تدخلها للمعلمة

ثم أدخل ومنبه، لتعريف معلمة، انقر فوق في الصف معايير لحقل تريد العمل •

نة، أدخل على سبيل المثال، إلنشاء معلمة للحقل مدي. مربعةبين أقواس المطالبة Accessعند تشغيل االستعالم، يعرض . مطالبة مماثلةأو [ أدخل اسم المدينة]

أدخل . هابتعريفالمطالبة التي قمت مربع الحوار إدخال قيمة معلمة، الذي يعرض

نتلاير على سبيل المثال، شيكاغو أو مو)القيمة التي تريد استخدامها كمعايير

تي يعود وصول مجموعة من السجالت ال. ، ثم انقر فوق موافق(للمعلمة المدينة

.تطابق المعايير التي تقدمها

انقر فوق . الخطوة الثانية في تحديد معلمة االستعالم لتحديد نوع بيانات المعلمة•

في . مأداة تصمياستعالم تبويب إخفاء على أدوات / معلمات في المجموعة إظهار

ما تما( بما في ذلك األقواس)مربع الحوار استعالم معلمات، أدخل اسم المعلمة

مثل )نات في العمود نوع البيانات، حدد نوع البيا. كما يظهر في شبكة التصميم.لمةللمعقمت بتعريفه حقل الذي يطابق ( نص قصير أو التاريخ مع الوقت

Abdullatif [email protected] To define a parameter for a query

لتعريف معلمة لالستعالم

1. In the Navigation pane, right-click the query, and then click Design View.

2. Enter the parameter in the Criteria row, enclosing the parameter in square brackets.

3. In the Show/Hide group, click Parameters.

4. In the Query Parameters dialog box, in the Parameter column, enter the parameter exactly as it appears in the design grid. In the Data Type column, select the data type for the parameter, and then click OK.

ثم , ممن جزء التنقل اضغط كليك يمين على االستعال1.

.اضغط عرض تصميم

أغلق المعلمة , ادخل المعلمة في سطر المعايير2.

.بقوسين مربعات

.اضغط معلمات, من مجموعة اظهار و إخفاء3.

, ةفي عمود المعلم, من مربع حوار معلمات االستعالم4.

. صميمادخل بالضبط المعلمة التي تظهر في شبكة الت

ثم , علمةاختر نوع البيانات للم, في عمود نوع البيانات

.اضغط موافق

Abdullatif [email protected]