Yorkshire Divers

Deep Blue Technical
Go Back   YD Scuba Diving Forums > Non-Diving Related Forums > Technology
User Name
Password

Welcome to the YD Scuba forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Technology: Discuss Using MS query part 2 in the Non-Diving Related Forums forums: Another little gem of a question, still using MS Query. I have a set of transactions - accounting journals hence debits ...

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-06-07, 12:54 PM
Ian@1904's Avatar
Ian@1904 Ian@1904 is online now
Team Starburst
 

Join Date: Jan 2004
Location: Bedfordshire
Posts: 3,990
Ian@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fishIan@1904 communes with fish
Using MS query part 2

Another little gem of a question, still using MS Query.

I have a set of transactions - accounting journals hence debits and credits.
The transactions are listed so that the positive and neagtive value all appear in the same column. What I want to achieve is splitting the values out.

If I was using Access I could extract the debit value from one query, and the credit(negative values) from another and then combine the two queries. MS query does not appear to allow me to do this.

Any ideas how to achieve this is MS query?

Nominal code Ref Debit Credit
1004 JNL1 45
1005 JNL1 55
1006 JNL1 -100

Aplogies on screen layout the -100 should be appearing under credit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 15-06-07, 01:13 PM
tootricky's Avatar
tootricky tootricky is offline
One of Digger's Angels
 

Join Date: May 2005
Location: Gosport, Hants
Posts: 1,386
tootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm watertootricky is a scuba diver - warm water
How about something along the lines of:

Code:
SELECT id, ref, IF trans_val < 0 THEN trans_val ELSE null AS debit, 
IF trans_val > 0 THEN trans_val ELSE null AS credit 
FROM transactions
NB: this is off the top of my head so not sure it would work in MS Query.

Cheers/Nic
__________________
Quote:
Originally Posted by Digger
We on the other hand, are an elite team of heart breakers for the elderly It will be like Charlie's Angels, but we will despatch our victims with heart attacks and strokes.
Don't wrestle with a pig. You'll only get as dirty as the pig & the pig likes it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Sponsored Links

Yorkshire Divers - RSS Feed
All times are GMT +1. The time now is 07:21 PM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0 RC6
Trademark and all rights reserved : © YD.com Ltd (2006)
YD.com Ltd (Registered in England - 05886696)
Other sites : Golf Clubs | New Premiership Football Kits | MP3 Portable Players | MP3 Players For Sale | Replica Football Kits

Forums Directory