Guild Wars Forums - GW Guru
 
 

Go Back   Guild Wars Forums - GW Guru > Forest of True Sight > Technician's Corner

Notices

Reply
 
Thread Tools Display Modes
Old Dec 01, 2008, 06:21 PM // 18:21   #1
Wilds Pathfinder
 
mazey vorstagg's Avatar
 
Join Date: Aug 2006
Location: Nodnol
Guild: Meeting of Lost Minds
Profession: E/Mo
Advertisement

Disable Ads
Default Baffled and SQL

Firstly, I'll say this is most likely the completely wrong place and even the completely wrong forum. However, I'm stuck.

If you can point me to a better forum to get this question answered I'd be very grateful. There seem to be a lot of SQL forums on the internet, and all of different varieties: MS SQL, MySQL, SQL server. I don't know what any of these mean so my 'SQL forums' google search was fruitless in terms of an obvious choice.

My question:

Quote:
I'm new to working with databases and I'm trying to create a query that will select only fields that's date matches the current date.

My table (Events) contains two columns, PDate and GName.
PDate contains a Date/Time and GName is text .

Currently my query looks like

Code:
SELECT       GName
FROM         Events
WHERE        PDate = DateTime.Today
I know that DateTime.Today isn't an SQL method, and it doesn't work currently (it just sees it as a parameter) but it works in Vb.net so I've put it there as a placeholder. If I run this in Access I get a message box asking me to fill in a value for the parameter DateTime.Today and when I fill it (with a date that is in my table) it returns the correct GName. The problem is, this needs to be automatic as I'm going to be calling this query through a VB.net application. So, how do I get SQL to read DateTime.Today (or something similar) from the system clock like VB does?

Thankyou very much
Mazey
So, can anyone help me out here? Either by answering my question or by pointing me to a forum where I'll get the answers I seek?

Thanks again

Mazey
mazey vorstagg is offline   Reply With Quote
Old Dec 01, 2008, 06:22 PM // 18:22   #2
God of Spammers
 
I pwnd U's Avatar
 
Join Date: Oct 2005
Location: in the middle of a burning cornfield...
Guild: Scars Meadows [SMS] (Officer)
Default

Might wanna try the Tech Corner. They are better at figuring out computer related stuff then us poor Off-topicer's.
I pwnd U is offline   Reply With Quote
Old Dec 01, 2008, 07:34 PM // 19:34   #3
Wilds Pathfinder
 
mazey vorstagg's Avatar
 
Join Date: Aug 2006
Location: Nodnol
Guild: Meeting of Lost Minds
Profession: E/Mo
Default

Ok. If I don't get answer here by tomorrow morning I'll repost.

Just don't want to double post needlessly
mazey vorstagg is offline   Reply With Quote
Old Dec 01, 2008, 07:47 PM // 19:47   #4
Grotto Attendant
 
zwei2stein's Avatar
 
Join Date: Jun 2006
Location: Europe
Guild: The German Order [GER]
Profession: N/
Default

Pretty much every SQL dialect has "Current Date" symbol. Did you try googling for access one?

If it fails, you can have your application simply supply date by inserting it there, duh, simple string operation.

...ERE PDate = '" + formatDateForSQL(DateTime.Today) + "'"

FormatForSQL is your function that prepares date string.
zwei2stein is offline   Reply With Quote
Old Dec 01, 2008, 11:12 PM // 23:12   #5
Furnace Stoker
 
Elder III's Avatar
 
Join Date: Jan 2007
Location: Ohio
Guild: I Will Never Join Your Guild (NTY)
Profession: R/
Default

start here:

http://en.wikipedia.org/wiki/SQL
Elder III is offline   Reply With Quote
Reply

Share This Forum!  
 
 
           

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:06 AM // 06:06.


Powered by: vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
jQuery(document).ready(checkAds()); function checkAds(){if (document.getElementById('adsense')!=undefined){document.write("_gaq.push(['_trackEvent', 'Adblock', 'Unblocked', 'false',,true]);");}else{document.write("