Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2006, 02:31 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query Probelm

Hello,

  I am doing an accounts application. Small company. Backend MSAccess.
Two tables are

Journal:

journalid
account_id
credit_amt
debit_amt
trdate
description

Transactions:

transid
account_id
credit_amt
debit_amt
trdate
description

Journal contains account payables and account receivables
Transactions contains payment details.

How can i generate a query to display account summary.

DATE WISE

suppose, i have 3 purchase invoices in the month Jun, 2006 on dates 1, 7, 15
And I made payments on 6, 9 and 25

The report must show from these two table of the account_id order by date(ascending)

Can anyone help me?
How can I pass parametr to a query in MSAccess from asp.net?

thanx in advance

 
Old June 7th, 2006, 10:48 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Doesn't look like you have the tables defined in the most efficient form. There's no need to duplicate information in tables. You only need to be able to link the tables with foreign keys. I'm not sure what you mean by Journal, but in the simplest form you will need an accounts table and a transactions table. Every transaction will have a transid (Unique ID) and an account_id.

SELECT * from Transactions INNER JOIN Accounts ON Transactions.account_id = Accounts.account_id
WHERE account_id = " & varAccount_ID & " AND DATEPART(month, trdate) = DATEPART(month,'" & varSearchDate & "') AND DATEPART(year, trdate) = DATEPARTYEAR(year,'" & varSearchDate & "') ORDER BY trdate;

Look in the BOL for DATEPART and BETWEEN. ORDER BY by default orders by ascending






Similar Threads
Thread Thread Starter Forum Replies Last Post
Probelm in DataGrid Display su C# 1 December 8th, 2006 05:00 AM
Kernel compilation probelm shyjumon.n Linux 1 October 24th, 2006 07:49 AM
probelm date format in MsMaskedEditControl shamimbd17 Pro VB 6 0 August 24th, 2006 01:08 AM
Probelm For Runing This Code farhad13841384 ASP.NET 2.0 Professional 0 August 3rd, 2006 01:37 AM
Performance probelm with tomcat manishwaf Servlets 0 May 29th, 2006 06:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.