Hi

I need Help in SQL. I've created a VB Project of Accounting, Using Access as a Backend database, In database I've 2 tables:

Table 1: Trans
Table 2: Trans_Details

Following Fields are in "Trans"

FieldName (Type) FieldName (Type) FieldName (Type)
Vno (Text) Vdate (Date) VNarr (Text)


Following Fields are in "Trans_Details"
FieldName (Type) FieldName (Type) FieldName (Type) FieldName(Type)
Vno (Text) AccId (Text) DebitAmnt (Number)CreditAmnt(Number)


What i need is a SQL query which give me All Transactions of particular AccId for a specific range of range of dates.

Please Help me on to this.

Waiting for anyone's quick response


Ahmed

This should work for the command text for a command object in ADO

Parameters Date1 DateTime;Date2 DateTime;SELECT * FROM Trans_Details INNER JOIN Trans ON Trans_Details.Vno=Trans.Vno WHERE Trans.Vdate>=Date1 AND Trans.Vdate<=Date2

Hi mnemtsas,

Thanx for your reply. The code you've given will reult all Transaction within a specific range. What i want is All Transaction in a specific range AND a AccId specified.


waiting for reply.

Ahmed

Parameters Date1 DateTime;Date2 DateTime;Account Text;SELECT * FROM Trans_Details INNER JOIN Trans ON Trans_Details.Vno=Trans.Vno WHERE Trans.Vdate>=Date1 AND Trans.Vdate<=Date2 and Accid=Account;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.